Why wont my method for "10.Methods 11" work? class Dog { int age; public Dog(int dogsAge) { age = dogsAge; } public void bark(){ System.out.printIn("Woof!"); } public void run(to the dog class) { System.out.printIn("Your dog


Replace this line with your code.


if you could please paste your code and error not in the title but in an actual forum post then it will be easier to help you out.


I have the same exact problem!! I reported the issue as a bug to CodeCademy..lets see how they respond.


Yeah the problem for me at least is that it keeps displaying it like its an error, despite clearly working in the output. I did what they said in the instruction exactly too ironically enough. It seems to not recognize that the run method is indeed between bark and main methods, despite it being so.

(Edit): I actually found the solution, you have to work through one step at a time for some reason. I saw on another forum that they had the same issue, and they fixed it by what I had just suggested.


what do you mean - work through one step at a time? run after each step? When I deleted all code - it still came up with the error (and the hint, "Did you call the bark method on the spike object? make sure you call it inside of the main method" - note - this is for step 9/13 from part 9, Using Methods; my apologies for posting in this section - it seems to be giving a similar error though).


In short, yes, you have to run the code after each step, as evidently, the program at that point in time can't keep up with all the code at once. I was literally trying to figure that out for an hour until I ran across another forum that discussed this issue and that was how it was resolved. And that's not to mention that the program is picky with where you place the code as we all have come to know.


Do this ex step by step.
1. just write
public void run() {

and, run
2. write the rest, then run


Done, it's working. thank for you sharing.


Why does it keep showing this error for me? I've even used 'get code' feature and yet it shows the same error!


Don't do all at once. you have to do step by step.At first complete only first instruction then go for the second

you should create a new post.dont post on other's topic.


I have also same problem @mohamed.saadat


@hardeepthiara - I got it resolved, do it step by step instead of doing it
in one go. Do the first task in it & run it, then the 2nd task and so on.
Works fine :slight_smile:


hello guys :smiley: im having the same problem but running one step at the time does not work for me for some reason. here's the code: public void bark() {



public void run () {

public static void main(String[] args) {


perhaps its a bug or maybe it did not want run to take in any parameters like an int.


you are great thank you


this work


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