Please help me.... why is it saying error despite it being correct?


#1


#2

If I am not wrong you misspelled dog :slight_smile: and also have not spaced the string correctly,

"your dpg ran" +feet + 'feet!"

should be,

"Your dog ran " + feet + " feet!"


#3

i have changed it but its still not working :sob:


#4

i have changed it but its still not working


#5

Please post your code instead of photos it is much more legible and easier to help you.


#6

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(5);
spike.bark();

}

#7

You haven't modified the string as i instructed you,

here,

exactly as the code in the instructions was written which is like this,

"Your dog ran " + feet + " feet!"


#8

Has it worked?:slight_smile:


#9

yes it has.... thank you so much :slight_smile: