i cant do this exercise so i pressed get code and even after he gave me the right code its still says “Did you create the run method? Place it between the bark and main method” in the error bar
heres my code:
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 static void main(String[] args) {
Dog spike = new Dog(5);
spike.bark();
spike.run(40);
}
}