Results 1 to 2 of 2
- 07-08-2010, 08:34 AM #1
Member
- Join Date
- Jul 2010
- Posts
- 1
- Rep Power
- 0
Syntax error in eclipse for "enum" defination.
Hi all, I am very new to eclipse.
I am using eclipse Version: 3.5.0 Build id: I20090611-1540 which i have just downloaded form download page.
I have a enum deceleration in one of my java file as follows.
enum OS{
Linux ("\\$\\{staging\\}\\/disa-linux-sensors","LinuxSensors.txt"),
HPUX ("\\$\\{staging\\}\\/disa-hpux-sensors","HPUXSensors.txt"),
AIX ("\\$\\{staging\\}\\/disa-aix-sensors","AIXSensors.txt"),
SunOS ("\\$\\{staging\\}\\/disa-solaris-sensors","SolarisSensors.txt");
private String pattern;
private String sensorsFile;
public String getPattern(){return pattern;}
public String getSensorsFile(){return sensorsFile;}
OS(String pattern,String sensorsFile){
this.pattern=pattern;
this.sensorsFile=sensorsFile;
}
}
For this code i am getting following syntax error at lines with red color.
Multiple markers at this line
- Return type for the method is missing
- Syntax error on tokens, delete these
tokens
at deceleration of Linux,AIX,HPUX,SunOS enum types.
Where as this get compiled successfully form my ant builder.
My Compiler compliance level is 1.5.
please suggest me if i am missing any preferences or anything else.
Thanks
- 07-08-2010, 09:21 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,589
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Runtime error "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
By shantimudigonda in forum New To JavaReplies: 1Last Post: 11-20-2009, 07:58 PM -
Syntax error on token "(", ; expected
By baltimore in forum AWT / SwingReplies: 3Last Post: 10-28-2009, 12:19 AM -
Syntax error on token "(", ; expected
By romilc in forum New To JavaReplies: 7Last Post: 10-24-2009, 01:23 AM -
Unfamiliar Syntax "int x = i1 << 24 | i2 ..."
By KentDMc in forum New To JavaReplies: 5Last Post: 04-11-2009, 03:21 AM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks