Solution for java 5 and java 6
As we know to compare string to string we need use method
string1.compareTo(string2);
so what you need to do is convert Enum to String
EnumExample.ENUM1.toString();
So now,to compare enum with string you need
string1.compareTo(EnumExample.ENUM1.toString());
Simple :)
No comments:
Post a Comment