<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>
Help me! I dont know where I wrong??
<Below this line, add a link to the EXACT exercise that you are stuck at.>
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(12);
spike.bark();
}
}
<In what way does your code behave incorrectly? Include ALL error messages.>
Dog.java:9: error: illegal start of expression
public void bark()
^
Dog.java:9: error: illegal start of expression
public void bark()
^
Dog.java:9: error: ‘;’ expected
public void bark()
^
3 errors
Replace this line with your code.
<do not remove the three backticks above>