Object-Oriented Java lesson 10

<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/methods-2?action=lesson_resume&link_content_target=interstitial_lesson

<In what way does your code behave incorrectly? Include ALL error messages.>
Did you create the run method? Place it between the bark and main method.

```

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(3);
spike.bark();
spike.run(4);

}

}

<do not remove the three backticks above>

Which step do you work on? I mean, which step that won’t accept your code? Is it the first step?

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