11/13 What do i wrong?


#1

Hi.

I have problems at the same chapter so may i put i t here?
They ask me to "Inside of main, set an int variable spikeAge to the value returned by spike.getAge();"
What do i wrong????

class Dog {
int age;

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

public void bark(){
System.out.println("woof!");
}
public void run(int feet){
System.out.println("your dog ran " + feet + " feet!");
}
public int getAge(){
return age;
}

public static void main(String[] args) {
Dog spike = new Dog(99);
    spike.bark();
spike.run(44);

int spikeAge = spike.getAge;

}

}


11/ 13 Using Methods II
#2

According to your code getAge is not a class property but rather a method. You are calling it as a variable in your code


#4