title: A final constant not accepted in switch case
body: <p>I would like to know the difference between the 2 declarations inside a method add() as in below.</p>
  
  <pre><code>final int c;
  c = 20;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>final int c = 20;
  </code></pre>
  
  <p>I think that both are final variables for which, I cannot reassign any new values. Here is the method that is treating the above declarations differently.</p>
  
  <pre><code>void add() {
          final int a = 30;
          final int b = 10;
          final int c;
          c = 20;
  
          switch (a) {
          case b + c:
              System.out.println("In case b+c");
              break;
  
          default:
              break;
          }
  
      }
  </code></pre>
  
  <p>The above method doesn't compile at all, complaining that </p>
  
  <blockquote>
    <p><strong>constant expression required case b+c</strong></p>
  </blockquote>
  
  <p>If the variable c is declared and initialized in one line, like <code>final int c = 30;</code>. It works. </p>