Hi Richard,
Thanks for the reply, Richard.
I read k&B swith statements... I understood that it is the case argument must be compile constants.
but i have not clear with the differences bewtween load time & compile time constatnts.
lets discuss this example :
class
Test {
public static void main(String args[]) {
final int a = 1 ; // compile time constant
final int b ; // runtime constant
b = 1 ;
int x = 1 ;
switch(x) {
case a: ; // okay
case b: ; // error: constant expression required
}
}
In the example above.. here,
final int b ;
b = 1;
variable b has been assigned value of 1, at compile time itself .
But , how come it become runtime constant.
Please explain me a bit and provide some reference to read.
Thanks
Vinay Rajnish