What results when you pass an empty string to a Java enum .valueOf call?
For example:
public enum Status
{
STARTED,
PROGRESS,
MESSAGE,
DONE;
}
and then
String empty = "";
switch(Status.valueOf(empty))
{
case STARTED:
case PROGRESS:
case MESSAGE:
case DONE:
{
System.out.println("is valid status");
break;
}
default:
{
System.out.println("is not valid");
}
}
Basically, I want to know if I'm using a switch statement with the enum, will the default case be called or will I get an exception of some sort?