Help on 12/13 error: cannot find symbol
return age;
symbol: variable age
location: class Dog
1 error

What is wrong with my variable?


Currently the age variable is defined locally inside of your constructor. It should be declared just above the constructor so that the whole class has access to it. That’s why it’s saying that it can not find the symbol. Because the symbol doesn’t exist in it’s scope.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.