d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > 5.java:1: Error: Class, Interface, Or Enum Expecte > Try To Help A Friend
Add Reply New Topic New Poll
Member
Posts: 5,693
Joined: Apr 16 2006
Gold: 5,078.92
Oct 20 2019 07:18am
Hi,
i have no idea what i am doing but i want to help a friend.. therefore i installed java stuff and at first it worked..

than i tried to compile a new file, and after that nothing is working anymore. Whenever I use the javac 5.java command, i get errors

5.java:1: error: class, interface, or enum expected
C:\Users\fabia\Desktop\java>javac 5.java
Quote
C:\Users\fabia\Desktop\java>javac 5.java
5.java:1: error: class, interface, or enum expected
for(int i=0; i<6; i++)
^
5.java:1: error: class, interface, or enum expected
for(int i=0; i<6; i++)
^
5.java:1: error: class, interface, or enum expected
for(int i=0; i<6; i++)
^
5.java:3: error: class, interface, or enum expected
for(int j=0; j<5; j++)
^
5.java:3: error: class, interface, or enum expected
for(int j=0; j<5; j++)
^
5 errors


This errors are based on the old file, but i try to compile a NEW file... therefore its somehow in the catch.. how can i delete this errors to be rdy to compile (javac ...) a new file?
Member
Posts: 5,693
Joined: Apr 16 2006
Gold: 5,078.92
Oct 20 2019 09:30am
fixed, problem was that i did not had the public class in my file:
public class HelloWorld {
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll