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
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss