7/13 Objects


#1



Replace this line with your code.


#2

Replace this line with your code.

it means you have to delete this line and write or paste your code in that place so we can see that :slight_smile:

tell us whats your problem?where did you get stuck? we cant help you without knowing your problem.


#3

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.)


#4

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