As from my previous comment, can you tell us if you have a class called Account in your org? If you do, then prefix all the places (apart from the soql) where you want to refer to the Account object with Schema.Account.
public class durga{
list<Schema.Account> alist=new list<Schema.Account>();
list<Schema.Account> a=[select id,name,industry from Account];
public void m12(){
for(Schema.Account acc:a){
acc.name='jaffa';
acc.industry='jaffa industry';
alist.add(acc);
}
update alist;
}
}
As Shayam said, I am sure you have a class name Acccount in your org. Best would be to update the className to something else or user the Schema.Account.
If you can provide your code then It helps us to give you best answer. But there is not any problem to assing a list of account to a list of account.
Plz check the code below:
public class durga
{
list<account> alist=new list<account>();
list<Account> a=[select id,name,industry from account];
public void m12()
{
for(account acc:a)
{
acc.name='jaffa';
acc.industry='jaffa industry';
alist.add(acc);
}
update alist;
}
}
There is no any error. And this code is running successfully in my org.
If you do, then prefix all the places (apart from the soql) where you want to refer to the Account object with Schema.Account.