Methods I in Java - Cannot move forward past bark method


#1

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);

	}

}

#2

Perhaps You need to call the bark method in the main method like this

Dog spike = new Dog(7);
spike.bark();

#3

i am struggling with it too.