Какие результаты при передаче пустой строки в вызов Java enum.valueOf?
Например:
public enum Status
{
STARTED,
PROGRESS,
MESSAGE,
DONE;
}
а затем
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");
}
}
В принципе, я хочу знать, могу ли я использовать оператор switch с перечислением, будет ли вызван случай по умолчанию или я получу какое-то исключение?