Still they want me to place the run method in between the bark and main method. Why?


#1



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


#2

it worked i simultaneously did all the steps and even they count /*comments*/ as error.


#3

I had the same exact problem! I reset the code and did it step by step, running it after each step instead of doing it all together. Maybe that will help you as well ?


#4

Codeacademy is a POS when their own application won't clear an error, even when you code it correctly.
Multiple exercises found where a user will code it correctly, yet it won't clear the error.


#5

Thanks for your attention friends i have solved the bug its just simple do it step wise you will not encounter any error. But in coming lessons of data structures they have some bug in exercise 7/13 if you encounter it then just simply refresh or restart the exercise.


#6

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