Error on 4/13 Classes: Instance Variable


I put in the code and keep getting an error. After trying different things, I still do not get help or the correct code. I am not sure what I am doing wrong. The error asks me "Did you create an instance variable called age? Place it inside of the class, but before the Dog constructor." Please help!

Below is my code: 
class Dog {
  **int modelAge;**

	public Dog() {

	public static void main(String[] args) {




Try removing the '*' and renaming the variable, form "modelAge" to "age".


Hello, thanks for the response. I still got an error when I tried that..


Add the 'public' access modifier before class Dog. That should work. :slight_smile:


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