+ Start a Discussion
Vijay@sfdcVijay@sfdc 

how to accesss var2 inside testmethod

Hello All,

 
class Sample 
{
     string var1

      public void testmethod()
   {
         string var2;
   }
}

Sample  obj = new Sample ();

 obj.testmethod();
  obj.var1= 1;

how to Access give data to var2 ?
 obj.var2= 'Test data var2';