I have a simple enum
public enum Columns {VENDOR, ITEM};
That I am trying to extract and drive a switch code block.
What I am getting classNotFound for what appears to be the inner class for the enum, b/c it shows [class]_A$0. I thought enum was a static final and created object that I could use directly in the switch. Can someone clarify?
colObject="VENDOR";
for (Columns c : Columns.values()) {
if (colObject.toUpperCase().equals(c.name())) {
System.out.println("Got it in iteration. i= " + i + " c= " +
c);
switch (c.valueOf(colObject.toUpperCase())) {
case VENDOR: {
System.out.println("Got it in switch case= " + c.name());
}
break;
default:
System.out.println("Fell thru.");
break;
}//end switch
}//end if
}//end for
"Got it in switch case= VENDOR") - no compile time or runtime errors. Can you provide a complete SSCCE which reproduces the issue, and some additional information on the JDK version you are using?