Need help on OOP -> Objects 7/7


#1

in learning Java and in the exercise of object orinted programing there in objects chapter that is 7/7 i have this code and i believe its correct can u plss help wts wrong

class Dog {

int age;

public Dog(int dogsAge) {

age = dogsAge;
}

public static void main(String[] args) {

Dog spike = new Dog (6);
}
}

#2

remove the space between Dog and (6)

do like
Dog spike = new Dog(6);


#3

than u it worked
thank u codecademy for helpfull forums


#4

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