title: Usage of switch statement in Java
body: <p>I got the case that, for example, number a can only be 1, 2, 3 or 4. Then I use it to build a switch block like:</p>
  
  <pre><code>switch (metadata.getValueType()) {
      case 1:
          method1();
          break;
      case 2:
          method2();
          break;
      case 3:
          method3();
          break;
      case 4:
          method4();
  }
  </code></pre>
  
  <p>But I know that writing switch block without <code>default</code> is not a good habbit, right? So I want to add a <code>default</code> after <code>case 4</code>. But I can make sure that there's no other case besides 1, 2, 3 and 4. What should I write in <code>default</code>?</p>
  
  <p>What is the best practice? Can I write nothing in case 4 as following:</p>
  
  <pre><code>switch (metadata.getValueType()) {
      case 1:
          method1();
          break;
      case 2:
          method2();
          break;
      case 3:
          method3();
          break;
      case 4:
      default:
          method4();
  }
  </code></pre>