posted 17 years ago
code:
---------------------------------------------------------------------------
final int a =1;
final int b;
b = 2;
int x =0;
switch(x)
case a: //ok
case b: //compiler error
---------------------------------------------------------------------------
your variable a and b should be a constant and should be declear as final ans static with iniialised value