I dnt understand how to do #10 oe section 3 i keep getting the same error but i dont know where i am getting it from


#1

strong text


Replace this line with your code.


#2

this works, try 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();

}

}


#3

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