+ Start a Discussion
Om PrakashOm Prakash 

Apex class variable best practice

Which is best practice from memory allocation view of point , if I have to show three or four fields on visualforce page :
public MyCustomObject__c oMyCustomObject{get;set;}


public String sNotes{get;set;}
public String sStatus{get;set;}
public datetime dClosedDate{get;set;}
Best Answer chosen by Om Prakash
Vijay NagarathinamVijay Nagarathinam

I think the first one is the best practice for accessing the variable in your visualforce page and also reduce the memory allocation.

For example: Public MyCustomObject__c customObj{get;set;}

you can access all the fields with the help of customObj instance

I think it will be helpful for you.