<In what way does your code behave incorrectly? Include ALL error messages.>
I tryid everything. I renew page 10 Times, restart browser, restart PC. I even copied right code for this lesson from other post on forum, still didnt work.
Please, somebody, help!!
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();
spike.run(40);
}
}
first write public void run(){}
2)secondly an int parameter inside the parentheses saying int feet
3)thirdly write System.out.println(“Your dog ran”+feet+“feet!”) inside the brackets of the method
4)then inside the main call run method on the spike object nd inside the parentheses put an int value of your choice and it would look something like spike.run(an int parameter of your choice);
normally I can solve the whole set of instructions, click run once and move on, this exercise did not recognize instruction 1 as being complete, but everything else worked!
To get around the buggy instructions, delete some of your work, do instruction 1 only, and run.
This worked, thank you. This console is frustrating
normally I can solve the whole set of
instructions, click run once and move on, this exercise did not
recognize instruction 1 as being complete, but everything else worked!
To get around the buggy instructions, delete some of your work, do instruction 1 only, and run.
int dogAge;
public Dog(int age) {
dogAge = age;
}
public void bark() {
System.out.println("Woof!");
}
public void run(int feet) {
System.out.println("Your dog run " + feet + " feet!");
}
public static void main(String[] args){
Dog spike = new Dog(4);
spike.bark();
spike.run(10);
}
}
Guys my code is working but i still find error message