Using Methods 9/13, followed instructions but will not let me move on

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/en/courses/learn-java/lessons/object-oriented-programming/exercises/using-methods-1

<In what way does your code behave incorrectly? Include ALL error messages.>
There is no error message. The program correctly prints out “Woof” but the task still has a red X next to it.

```

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

}

<do not remove the three backticks above>

Your code is missing one function,

public void run(int feet) {
System.out.println(“Your dog ran " + feet + " feet!”);

And a quite a number of function calls that refer to your defined functions,

spike.run(100);
int spikeAge =
spike.getAge();
System.out.println(spikeAge);
spike.checkStatus();

I had the same problem. And I was getting so annoyed cuz I knew it was correct. This is so stupid, but you just have to change “Woof” to lower case ‘w’, “woof”.

I stuck on 9/13 too but I tried making the w lowercase and it did not work and I don’t understand bandits code and where do I put it lol

1 Like

I’m stuck on this as well. Anyone?

yes, answer correct is

spike.bark();

I just restarted the exercise by the “get help” button and the code worked perfectly.

i found the problem. in the method, you must write Woof! with the exclamation

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