Exercise 10. Methods: || Confused

As I was trying to complete step 1 by adding a method called run to the Dog Class and I typed it has it showed, I kept getting the red X of failure stating, "Did you create the run method? Place it between the bark and main method.

I looked on the forum, and I placed it where others did, punctuation looked correct and I still kept getting the error message? Anyway, Codecademy gave me the option to get code so I did. Next thing you know it completed steps 1-4 for me?
Can anyone that has done this section explain to me what was wrong with my code when it seemed correctly placed without syntax errors AND why does Codecademy complete all four sections, when I just needed help with step 1?

I’m having the same issue and I came here to find an answer. Not sure why it’s not letting me through.

I’ve also gotten this same problem. What’s the deal?


Same problem here … I put the run method where it asked.

In between the bark and main methods, add a method called run to the Dog class by typing:

public void run() {


Here’s the code:

class Dog {
  int age;

  public Dog(int dogsAge) {
  	age = dogsAge;

  public void bark() {


  public void run() {

  public static void main(String[] args) {
    Dog spike = new Dog(5);



The same sort of thing happened earlier in this lesson. I clicked the ‘get code’ button and it gave me EXACTLY what I had written with the exception that the code worked.

I was able to get past this, without having to click the ‘get code’ button, by going through and completing the rest of the steps before clicking the ‘run’ button.


It’s really stupid, but it works! Thanks a lot.

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