Guys (and girls ;-))
I am reading the Bathy and Berts book and have a doubt about the case construct. Yhe book says "The case argument has to be resolved at compile time, so that means you can use only a constant or final variable that is assigned a literal value." It also has an example:
Ok, my doubt is: why do we get a compiler error when using variable b? I mean, it's declared final, and is assigned a value before the case test
. So, in my opinion, it can be considered a constant, but Kathy (and the compiler, by the way) tell me otherwise. Could someone please explain this to me?
Pedro Ivo Dantas