Well I have a problem,
I have made this code:
class Dog {
int age;
public Dog(int dogsAge) {
age = dogsAge;
}
public void bark() {
System.out.println("Woof");
}
public static void main(String[] args) {
Dog spike = new Dog(3);
spike.bark();
}
}
An I got “woof” on the other screen, but it ceeps saying that it is wrong but I have don the command
So I don’t know what I did wrong.
Could you help me?
(Btw. this is the command
Inside of the main method of the Dog class, call the bark method on the spike object.)