Not sure what I’ve been doing wrong. I tried to write according to what the first step had told me, but it hasn’t been registering as correct. I don’t get error messages in the black box next to the code, if that helps any.
Thanks.
//Create a Dog class
class Dog {
int age;
public Dog(int dogsAge) {
age = dogsAge;
}
public void bark() {
System.out.println("Woof!"); /** displays when program runs **/
}
public void run(int feet) { //amount of ft
System.out.println("Your dog ran " + feet + " feet!"); // adds the int for ft ran, red code
}
public int getAge() {
return age;
}
public static void main(String[] args) {
Dog spike = new Dog(5);
spike.bark();
spike.run(2521620); //set amount
}
}