8. Methods Cannot find symbol

<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.>

https://www.codecademy.com/courses/learn-java/lessons/object-oriented-programming/exercises/methods-1

<It shows Dog.java:18: error: cannot find symbol
Dog spike = new age(4);
^
symbol: class age
location: class Dog
1 error>

```

class Dog {

int age;

public Dog(int dogsAge){

age = dogsAge;

}

public void bark(){

System.out.println(“Woof!”);

}

public static void main(String[] args){

	Dog spike = new age(4); 

}

}

<do not remove the three backticks above>

You donot have any class implementation called age that’s the compiler is complaining.

Thank You problem solved. it was new “Dog” not age…

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