title: Why is default required for a switch on an enum?
body: <p>Normally, default is not necessary in a switch statement. However, in the following situation the code successfully compiles only when I uncomment the default statement. Can anybody explain why?</p>
  
  <pre><code>public enum XYZ {A,B};
  public static String testSwitch(XYZ xyz)
  {
      switch(xyz)
      {
      case A:
          return "A";
      case B:
      //default:
          return "B";
      }
  }
  </code></pre>