12/13 cant get to work?

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

```

Why wont this work?

<do not remove the three backticks above>

checkStatus.spike() //wrong

it must be

spike.checkStatus();

nope…it still gives me the same error.

can you please give the full screen shot?

Never mind i got it ,but thanks anyways.

class Dog extends Animal {

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 int getAge() {

return age;

}

public static void main(String[] args) {

Dog spike = new Dog(5);
spike.bark();
spike.run(40);
int spikeAge = spike.getAge();
System.out.println(spikeAge);
spike.checkStatus();

}

}

Dog.java:11: error: illegal start of type
public void bark({
^
Dog.java:11: error: ‘)’ expected
public void bark({
^
Dog.java:12: error: ‘;’ expected
System.out.println(“Woof!”);}
^
Dog.java:12: error: expected
System.out.println(“Woof!”);}
^
Dog.java:12: error: illegal start of type
System.out.println(“Woof!”);}
^
Dog.java:14: error: class, interface, or enum expected
public void run(int feet){
^
Dog.java:18: error: class, interface, or enum expected
}
^
Dog.java:20: error: class, interface, or enum expected
public int getAge(){
^
Dog.java:24: error: class, interface, or enum expected
}
^
Dog.java:26: error: class, interface, or enum expected
public static void main(String args) {
^
Dog.java:30: error: class, interface, or enum expected
Dog spike = new Dog(5);
^
Dog.java:32: error: class, interface, or enum expected
spike.bark();
^
Dog.java:34: error: class, interface, or enum expected
spike.run(345);
^
Dog.java:36: error: class, interface, or enum expected
int spikeAge = spike.getAge();
^
Dog.java:38: error: class, interface, or enum expected
System.out.println(spikeAge);
^
Dog.java:39: error: class, interface, or enum expected
}
^
16 errors

i got it but thank you aney way!

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