Using Methods, Excercise 9/13 stuck


I keep getting the following error message: "Did you call the bark method on the spike object? Make sure you call it inside of the main method."
As far as I can tell my code follows the instructions, and I do get the required output at the output window to the right.
Any help on this error will be appreciated.

class Dog{
  int age;
  public Dog(int dogsAge) {
    age = dogsAge;
  public void bark() {
  public static void main(String[] args) {
    Dog spike = new Dog(10);


@natanmel ,

This might not produce a loud enough bark ...


Revisit the instructions here.


In the example class Car, the method startEngine is not in blue text, whereas the method bark is in blue text in the picture yet it is not displayed in blue text in my coding window. Any help woul be much apprecitated as I can't continue till it's fixed.


Hi @jdavis0 and spike :

The color of the text is OK the way it is.

You have this ...


As was the case with the original poster, your bark method needs to conform precisely to the instructions of the previous exercise ...

Inside the bark method, type:


OK, spike, let's exclaim a nice loud bark! :wink:


Ahh now I understand your earlier reply! Thanks for the late night response!


No problem; just a Woof! from a neighbor's dog that woke me up. :slight_smile:


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