title: What results when you pass an invalid String to a Java enum .valueOf call?
body: <p>What results when you pass an empty <code>String</code> (or some other unrecognized value, or a <code>null</code>) to a Java enum <code>.valueOf</code> call?</p>
  <p>For example:</p>
  <pre><code>public enum Status
  {
     STARTED,
     PROGRESS,
     MESSAGE,
     DONE;
  }
  </code></pre>
  <p>and then</p>
  <pre><code>String empty = &quot;&quot;;
  
  switch(Status.valueOf(empty))
  {
     case STARTED:
     case PROGRESS:
     case MESSAGE:
     case DONE:
     {
        System.out.println(&quot;is valid status&quot;);
        break;
     }
     default:
     {
        System.out.println(&quot;is not valid&quot;);
     }
  }
  </code></pre>
  <hr />
  <p>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?</p>