hi Shridhar your code look good and its working fine in my org
Maybe you're apex class is not save properly. make sure your apex class is save properly if you seen * with your class name its mean your class not save yet. by the [ctrl+ s ] save your apex class
thanks
All Answers
public string name;
public integer age;
public void meow(){
system.debug('hello');
}
}
Cat c = new Cat();
c.name = 'tiger';
c.age = 15;
c.meow();
system.debug('cat name is '+c.name);
system.debug('cat age is '+c.age);
Error
Execute Anomynous Error
Line: 2, Column: 1
Variable does not exist: name
public class Cat {
public string name{get;set;}
public integer age{get;set;}
public void meow(){
system.debug('hello');
}
}
Then try below code
Cat c = new Cat();
c.name = 'tiger';
c.age = 15;
c.meow();
system.debug('cat name is '+c.name);
system.debug('cat age is '+c.age);
its showing same error...
your code look good and its working fine in my org
Maybe you're apex class is not save properly. make sure your apex class is save properly
if you seen * with your class name its mean your class not save yet.
by the [ctrl+ s ] save your apex class
thanks
let me inform if it helps you
thanks