Help on 12/13


#1

Dog.java:14: error: cannot find symbol
return age;
^
symbol: variable age
location: class Dog
1 error

What is wrong with my variable?


#2

Hey.

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.


#3

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