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
Nagaraju MogiliNagaraju Mogili 

I was unable to execute the code

Apex code

public class me {

   public list<Schema.Account> Acc {get;set;}
   
   
   public me (){
     list<Schema.Account> Acc = new list<Schema.Account>();
     Acc = [select id,name,phone from Account];
   }
}

VF code::

<apex:page controller="me" sidebar="false">
   <apex:form >
     
<apex:pageblock id="pb">
<apex:pageblocktable value="{!acc}" var="c">
<apex:column value="{!c.name}"/>
<apex:column value="{!c.phone}"/>
</apex:pageblocktable>


</apex:pageblock>
</apex:form>
</apex:page>
Alain CabonAlain Cabon
You don't need to use Schema. You need a simple custom class not a dynamic sObject.

 public list<Schema.Account> Acc {get;set;} =>  public list <Account> Acc {get;set;}

Use Schema.object_name to refer to an sObject that has the same name as a custom class.
This disambiguation instructs the Apex runtime to use the sObject.

// Create a standard Account object myAccountSObject
Schema.Account myAccountSObject = new Schema.Account();
// Create accountClassInstance, a custom class in your org
Account accountClassInstance = new Account();
myAccountSObject.Name = 'Snazzy Account';
accountClassInstance.myInteger = 1;

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_schema_namespace_using.htm?search_text=Schema.account