//even though i’m able to successfully get the o/p-unable to proceed further-please help with this-Thanks in advance!!
class Dog {
int age;
public Dog(int dogsAge) {
age = dogsAge;
}
public void bark() {
System.out.println("Woof!");
}
public void ran(int feet) {
System.out.println("Your dog ran " + feet + " feet!");
}
public static void main(String[] args) {
Dog spike = new Dog(5);
spike.bark();
spike.ran(40);
}
The first is that the function should be named “run”, not “ran”. While your code is perfectly valid, the codecademy parser is pretty strict with what it does and doesn’t allow.
The second thing to note is, you have to follow the instructions step by step on this assignment. Then parser is looking for an empty function like so
public void run(){
}
Once you do that, follow the steps in the tutorial one by one, and you’ll finish it no problem!
I followed the instructions. The code works. I even tried “get the code” option as I couldn’t do it, but it still shows the message that the run method is not between the bark and the main one. But it is and I can’t go further…