Error Message: Dog.java:3: error: class Dog is already defined in package unnamed package
class Dog extends Animal {
^
Dog.java:11: error: cannot find symbol
age = dogsAge;
^
symbol: variable age
location: class Dog
Dog.java:29: error: cannot find symbol
return age;
^
symbol: variable age
location: class Dog
Dog.java:35: error: non-static variable this cannot be referenced from a static context
Dog spike = new Dog(5);
^
Dog.java:36: error: cannot find symbol
spike.bark();
^
symbol: method bark()
location: variable spike of type Dog.Dog
Dog.java:37: error: cannot find symbol
spike.run(40);
^
symbol: method run(int)
location: variable spike of type Dog.Dog
Dog.java:38: error: cannot find symbol
int spikeAge = spike.getAge();
^
symbol: method getAge()
location: variable spike of type Dog.Dog
7 errors
class Dog {
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>