The rule for a 'case' is compile- time constants, and variable 'b' isnt considered so, its assigned a value later hence not become compile time constant. You would have to declare and inialize the final variable in 1 line, like this:
variable a is given value at compilation time only so its compile time constant but variable b is not getting any value till it runs.so run time value assigned. so not comiple time constant
Get meta with me! What pursues us is our own obsessions! But not this tiny ad: