I may get result of any of the type , so i am defining enum this way
public enum Result
{
1, 2,3, 4,5, 6,7, 8
}
String resultvalue = calculateResult();
switch (Result .valueOf(resultvalue ))
{
}
But i am geting error at the Enum Declaration itself saying Mispalced Constructors .
Could anybody please help me
Those aren't valid identifiers for enum values, basically. You'll need to prefix them with a letter or _. You'll also need to make the identifiers unique - currently you've got 0010 four times...
Once you've sorted that out, the rest should probably be okay - but if you have any more problems, please post a short but complete program, rather than snippets.
0001 is not a valid Java identifier. A Java Identifier must not start with a digit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With