7/13 error displayed


#1



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


I'm getting this error message, what should i improve in my code?

"Did you create a Dog object using the Dog constructor? Make sure you indicate an integer parameter. Use the example to help you."


class Dog {
  
  int age;

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

	public static void main(String[] args) {

    Dog pies = new Dog(10);
	}

}


#2

Hey there.

The instructions are pretty specific as in they want you to name the Dog object spike and nothing else. Doing so should solve your issues here :slight_smile:


#3

Thanks! Another reason to get my eyes checked.


#4

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