Keeps giving me errors dont know whats wrong now

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

```

Replace this line with your code.

class Dog{
int age;

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

public static void main(String[] args) {

Dog Dog = new Dog(spike);

}

}

<do not remove the three backticks above>

Exercise 5. Classes: Constructor Parameters has asked for your Dog constructor to have a parameter called dogsAge, you have missed that detail. You’ve used age instead:

public Dog(int age)

On the next line, don’t forget to assign dogsAge to age.

Exercise 7. Objects is where you use your new constructor to create a new Dog object. You’ve got that line a bit mixed up. You have this:

Dog Dog = new Dog(spike);

To create a Dog named spike you would start off with:

Dog spike = 

Then you would use new Dog() to pass spike’s age in as a parameter rather than his name. Remember the constructor, it is expecting you to send it a dogsAge, not a dogsName.

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