Sir / Madam
I am studying for the SCJP 1.5 exam.(310-055)
Please find below the code:
final int a = 1;
final int b;
case a: //compiles fine
case b: // compiler error
My doubt is why does the case b satatement throw compiler error. The book says that the case constants have to be COMPILE TIME CONSTANTS. What exactly are COMPILE TIME CONSTANTS? Moreover, isn't b a constant here as we have initialized it to 2 here? Please clarify.
Infosys Technologies Ltd. Pune, India.