What is the difference between final variables and compile time constants?
Consider the following code
final int a = 5; final int b; b=6; int x=0; switch
The switch statement needs a constant. As final variables can be delayed initialized and the compiler cannot determine for b that it has a value in the case branch.