7. Objects



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




Dog spike = new Dog(11);

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


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