0
Please explain me the "Error: Class, interface or enum expected "
This occurs in Java and this is happening for very long time which is getting on my nerves. Give me the solution along with some examples by explaining what is class, interface and enum.
5 Answers
+ 6
Imagine poor Java, it's telling you it wants/expects one of these things and you insist on not providing it in the code.
Look at your code and see if you are using any of these things.
If you don't know what they are, you should complete the Java course, or take it again.
+ 4
If you need help with your code, please link your code so we can have a look at it.
+ 3
Shubham Sonawane If you don't know what I am talking about. Start a new Java code bit and you will see that everything of the starter code is contained by the class.
There are a few things that will be outside a class (or interface or enum) body. Eg:
import somepackage;
+ 2
Do you have some code that should be inside a class not contained by a class (or interface or enum)?
+ 1
Ausgrindtube okay