posted 15 years ago
Case accepts only compile time constants.
To create a compile-time constants, it should be initialized at the time of declaration.
final int a=5; <-- This is a Compile time constant.
final int b;
b=10; <-- This is NOT a compile time constant(but a runtime constant)