42
Originally posted by John Meyers:
You also need to make sure that the defenition and declaration occur in the same line.
final int i;
i = 10;
is not the same as
final int i=10;
The former code fragment will not enable the compiler to know what the final value is.
.
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
"Nothing is harder on your aurels than resting on them."<br />SCJP 1.4 89%,,SCJA 80%,SCWCD1.4 81%
Originally posted by John Meyers:
Sorry about not being more specific...
This is what i meant:
final int i = 10;
byte b = i;
final int eye;
eye = 10;
b = eye; // fails
b=eye fails because the final int eye; is not a compile time constant. The value of eye is initialized later, after it has been defined.
Originally posted by Rupal:
Hi Bert,
Was not aware of the naming policy ,sorry for that .
Regards
Rupal(previously scjp)