Method 10/13 - Message error appears


#1

It shows a message error, even though there's nothing wrong with it.

1.
In between the bark and main methods, add a method called run to the Dog class by typing:
public void run() {
}

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(12);
    spike.bark();
    spike.run(10);
	}
}

How to fix it?


#2

do ONLY instruction 1. then run.

then do the rest of the instructions and run again. (for me only necessary to run twice total)


#3

That worked! Thank you very much!


#4

yes
thank you it rocks


#5

Thank you for the help!


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.