+ Start a Discussion
Lukesh KarmoreLukesh Karmore 

can any one explain me

see below some code  of wrapper class
 public void ProcessSelected(){
selectedAccounts=new list<account>();
for(wrapaccount wrapobj:wrapaccountlist){ if(wrapobj.isSelected==true){

public class wrapaccount{
public account accn{get;set;}
public boolean isSelected{get;set;}
public wrapaccount(account a){
it is not full code , so my question is 
in above codeLine  why we did this wrapobj.accn
can any one  answer me .
Thank You
Akshay Dhiman 63Akshay Dhiman 63
Hi Lukesh,
I have gone through your query. So, when we create a Wrapper class then we have to make its instance to access its variables. Like here you have created a wrapper class and variables in it. So to access these variables we create an instance(wrapob) of class(wrapaccount) so you can access variables using this.


Hope this explanation will resolve your query. Mark it as the best answer if you find it helpful.