Re: compiler question



In article <48681888$0$14348$e4fe514c@xxxxxxxxxxxxxx>,
Maarten Bodewes <maarten.bodewes@xxxxxxxxx> wrote:
[...]
Yup, and to be sure that your variable will only be assigned precisely
once, create it using the final keyword.

final int thePrice;
if(..) thePrice = 1;
else thePrice = 2;

This will throw a compiler error whenever thePrice is not assigned, or
when thePrice is assigned a second time. Much more secure.

Aha, I had seen this in Roedy's and others' code without fully
understanding its import. I'm a fan of letting the compiler do the
work:-) Thanks!

[...]
--
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews
.