i am new to salesforce.
i have doubt on collection list
1. I need to retrieve records from an object(Ex: Account)
2. Then I have to add those records to collection LIST dynamically one by one
i have use below code But it's giving error So i don't know how to achive it
list<string> s = new list<string>();
for (Account tmp : [SELECT name FROM Account order by name])
s.add(tmp);// to add records to list