posted 22 years ago
A method has a final parameter z. Now at 2 I am merely using the value of z, I am
not modifying z. Still there is compiler error.
I could not convince myself for this behavior, for I think that final variable can be assigned value only once, but this value can be used frequently.
Public double x(int y, final double z){
z=z/2;
return y * z;//compiler error//2
}
z has been declared final, and its value can not be modified