7. Objects


#1



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


/error message/ 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 Spike = new Dog(6);

    
	}

}


#2

Dog spike = new Dog(11);

i dont know if this will make a difference but use a lower case s on spike


#3

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