9/13 error


#1

Hi guys i'm stuck at exercise 9. I did everything i should but there's 3 errors and i don't know what to do.
The error messages are
: Dog.java:7: error: illegal start of expression
public void bark () {
^
Dog.java:7: error: illegal start of expression
public void bark () {
^
Dog.java:7: error: ';' expected
public void bark () {
^

My code is 
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();
     
        
   }
  
 
  

}

#2

Ok i managed to solve it myself. The problem was withing "{" placements


#3

Where did you put the '{'.


#4

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