function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ReddyReddy 

How to Fetch the Account Records from Account Object Using SOQL

 List<Account> la = [SELECT Id,Industry,Name,Rating FROM Account LIMIT 10];
if(la.size() > 0)
{
    system.debug('Records Count….: '+ la.size());
        for(Account acc: la )
    {
        system.debug(acc.id + ' —> ' + acc.Name + ' —> '+ acc.Rating + ' —> '+ acc.Industry);
    }
}
 
this is the error 
Illegal assignment from List&lt;Account&gt; to List&lt;Account&gt;
Best Answer chosen by Reddy
sfdcMonkey.comsfdcMonkey.com
and i test your code in my developer org its working fine can you share your whole code and requirement so i review properly
 

All Answers

ReddyReddy
Illegal assignment from List&lt;Account&gt; to List&lt;Account&gt; this is error sir 
what is that found '&lt;EOF&gt;'  ,  List&lt;Account&gt; to List&lt;Account&gt;
just  tell me sir 
 Thanks
 
sfdcMonkey.comsfdcMonkey.com
hi Reddy
maybe In your organization somewhere you have created a class named "Account". Thats why the compiler is not able to understand that it is standard Object Account or the class created by you. Please rename your class if you have,
 
ReddyReddy
And in workbench  exactly working but console Application not working

in workbench  site is working but in ConsoleApplication not working 
sfdcMonkey.comsfdcMonkey.com
and i test your code in my developer org its working fine can you share your whole code and requirement so i review properly
 
This was selected as the best answer
ReddyReddy
yas sir i am created a class name "Account"......... 
Thanking you sir