Exercise 10- console bad


#1

Good afternon.
in the exercise 10, when run the code show the next to error.
Did you creat method run? place it between the bar and main method.

i cheking the code again and next to show the same error.
this is 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);

}

public static void main(String[] args) {

Dog spike = new Dog(5);
spike.bark();
spike.run(40);

}

}


#2

please post your code with the link that goes to the lesson and tell us what's your problem


#3

yeah please post your code


#4

even though, you may got the answer from the system. please erase it and apply for step by step. in that way, the program runs perfectly.


#5

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