12&13/13.help,

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/en/courses/learn-java/lessons/object-oriented-programming/exercises/inheritance

<In what way does your code behave incorrectly? Include ALL error messages.>
since checkStatus is not defined , console expect to show an error but it shows “Your pet is healthy and happy!” I dont see that on my codes …why is it??

```

class Dog extends Animal {

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(5);
spike.bark();
spike.run(40);
int spikeAge = spike.getAge();
System.out.println(spikeAge);
spike.checkStatus();

}

}

<do not remove the three backticks above>

If your class failed to compile perhaps it was running one that you had compiled earlier

I got how it works thank you for your guidance :wink:

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