9. I am having the error message appear


#1

I am having the error message appear: "Did you call the bark method on the spike object?"
I don't know where I am going wrong here: My code is below:

public 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();
}
}


Using Methods 9/13 issues
#2

A post was split to a new topic: 9. I copied the example exactly but put in the information the instructions ask for but I still get an error asking if I called the bark method


#3

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