5/13 Help me please, I don’t understand error message


#1

I got stuck on 5/13, my goal is "Inside of the constructor block, set the instance variable age equal to the dogsAge parameter" . My code is

> class Dog {
> int age;

>   public Dog(int dogsAge) 
>   {  
>   				age = dogsAge ;
> 	}


> 	public static void main(String[] args) 
>   {

> 	}

> }

And it keeps send me an error message "Set age equal to dogsAge inside of the constructor block. Use the example to help you."

I don't know where my mistake is, please help :sob:


#2

class Dog{

int age;
public Dog(int dogsAge){

age = dogsAge;
}

public static void main(String[] args) {

}
}

check the ; . you left a space between the dogsAge variable.


#3

Thank you, it worked :smiley:

Thank you very much for your help .


#4

Thnx I did the same thing too!