7/13 Did you create a Dog object using the Dog constructor? Make sure you indicate an integer parameter


#1

What is wrong with my code?

class Dog {

int age;

public Dog(int dogsAge) {

age = dogsAge;

}

public static void main(String[] args) {

Dog spike = new Dog (6);

}
}


#2

Just worked out it's the space between the Dog and the (6) :slight_smile:


#3

4 posts were split to a new topic: 7. i'm stuck


#7

A post was split to a new topic: Why it does not work?


#8