3/13 Error

<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.>

https://www.codecademy.com/en/courses/learn-java/lessons/object-oriented-programming/exercises/classes-constructors?action=resume
<In what way does your code behave incorrectly? Include ALL error messages.>
Did you create a Dog constructor? Use the example to help you.

Dog.java:11: error: class, interface, or enum expected public static void main(String[] args) { ^ 1 error

```

//Create a custom Dog class
class Dog {

//The class constructor for the Dog class

public Dog () { 
	}

}

public static void main(String args) {

}

<do not remove the three backticks above>
1 Like

//Create a custom Dog class
class Dog {

public Dog () { 
	}

}

public static void main(String args) {

}

I changed my code to this, and it allows me to continue on to the next exercise, but im still getting this error for some reason, even though it says I've done it correctly in the check list.

error message: Dog.java:10: error: class, interface, or enum expected public static void main(String[] args) { ^ 1 error

This method needs to be inside the class body.

class Dog {

    public Dog () {

    }

    public static void main(String[] args) {

    }
}
1 Like

THANK YOU! That worked :slight_smile:

1 Like

I happened to delete my comment line

//The class constructor for the Dog class

and then it worked!!! So Frustrated

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