ENUM declaration Syntax Error
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, May 19, 2009 05:30 AM

I am using Eclipse Platform Version: 3.4.1 and Java build 1.5.0_02-b09. When I try to build the following ENUM declaration code using the eclipse. I am getting the errors listed below the code. public interface Constant { public enum Info { private int index; Info(int index) { this.index = index; } INFO1(4), INFO2(5), INFO3(6), INFO4(7), INFO5(8), INFO6(9), INFO7(10); } } Return type for the method is missing Syntax error on token ",", @ expected Syntax error on token ",", @ expected Syntax error on token ",", @ expected Syntax error on token "   More>>

I am using Eclipse Platform Version: 3.4.1 and Java build 1.5.0_02-b09. When I try to build the following ENUM declaration code using the eclipse. I am getting the errors listed below the code.

			
public interface Constant {
public enum Info {
private int index;

Info(int index) {
this.index = index;
}

INFO1(4),
INFO2(5),
INFO3(6),
INFO4(7),
INFO5(8),
INFO6(9),
INFO7(10);
}
}


Return type for the method is missing
Syntax error on token ",", @ expected
Syntax error on token ",", @ expected
Syntax error on token ",", @ expected
Syntax error on token ",", @ expected
Syntax error on token ",", @ expected
Syntax error on token ",", @ expected
Syntax error on token "INFO1", AnnotationName expected
Syntax error, insert ";" to complete ConstructorDeclaration
Syntax error, insert ")" to complete ConstructorDeclaration
Syntax error, insert ")" to complete SingleMemberAnnotation
Syntax error, insert "}" to complete EnumBody
Syntax error, insert "Identifier (" to complete ConstructorHeaderName
Syntax error, insert "Identifier" to complete EnumConstantHeaderName    <<Less
About | Sitemap | Contact