You need to sign in to do that
Don't have an account?
chandrasekhar reddy
Error in creating Enum?
I have below Enum class.
Error: Compile Error: expecting right curly bracket, found '(' at line 2 column 11
Any help Please?
public enum SfOperationStatus { SUCCESS("The SalesForce.com operation was successful."), Unsuccessful("The SalesForce.com operation was unsuccessful."), Error("An error occurred while executing the SalesForce.com operation."), ; private String msg; private SfOperationStatus(String message) { this.msg = message; } public String getMessage() { return this.msg; } }Above code gives below error.
Error: Compile Error: expecting right curly bracket, found '(' at line 2 column 11
Any help Please?
Like :
public enum SfOperationStatus { SUCCESS, Unsuccessful, Error}
sample:
public enum Season {WINTER, SPRING, SUMMER, FALL} Season s = Season.SUMMER; if (s == Season.SUMMER) { // Will write the string value SUMMER System.debug(s); } else { System.debug('Not summer.'); }
reference:
http://www.salesforce.com/us/developer/docs/apex_workbook/Content/apex3_6.htm