47.6k views
5 votes
How do you fix a class, interface, or enum expected in this code

How do you fix a class, interface, or enum expected in this code-example-1
User Fsasvari
by
5.7k points

1 Answer

2 votes

Answer:

The class interface or enum expected error is a compile-time error in Java which arises due to curly braces. ...Code. ...Here, the error can be corrected by simply removing the extra bracket,​ or by keeping an eye on the indentation.class Main { ...Case 2 (function outside class)

Step-by-step explanation:

User Broguyman
by
5.3k points