I get the error "Did you create the bark method? Place it between the constructor and the main method. I try to run the code and after a few tries it will give me the option to “get code” or keep trying. If I hit get code and then run the code that they give me it will keep giving me the same error that I posted above. It is giving me an error code on their code that they provide me. I posted the code below:
class Dog{
int age;
public Dog(int dogsAge) {
age = dogsAge;
}
public void bark() {
System.out.println("Woof!");
}
public static void main(String[] args) {
Dog spike = new Dog(7);
}
}