8. Methods Cannot find symbol


#1


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); 
  
  }

}


#2

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


#3

Thank You problem solved. it was new "Dog" not age..


#4

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