12: Inheritance


#1

Hey there! On 12: Heritance, I appear to be having trouble with going on. Every time I run it, it gives me the error-
Dog.java:3: error: expected
spike.checkStatus();
^
Dog.java:33: error: '.class' expected
spike.getAge(int 5)
^
Dog.java:33: error: ';' expected
spike.getAge(int 5)
^
3 errors
-------------------------------------------------------------------------+
My code is-
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(7000);
spike.getAge(int 5)
spike.checkStatus();

int spikeAge = spike.getAge();
System.out.println(spikeAge);

}

}


#2

I found my own mistake! After redoing it several times, I learned that the spike.getAge(); was not needed. Sorry everyone!


#3