title: How can non-final variables be switch constants?
body: <pre><code>public class SwitchTest {
  
  public static void main(String[] args) {
      Integer i = new Integer(2) + new Integer(2);
  
      switch(i){
        case 4: System.out.println("foo"); break;
        default: System.out.println("default"); break;
      }
    }
  }
  </code></pre>
  
  <p>Integer i is not marked as final. (I'm only a beginner in java.)</p>