A variable is considered a 'constant variable' only if it is declared: (a) with the 'final' modifier (b) with an initializer that's a compile-time constant expression
where a 'compile-time constant expression' is basically an expression that's made up of only literals and other constant expressions or constant variables. (See the Java Language Spec for a more formal definition.)
[ November 10, 2007: Message edited by: Kelvin Lim ]
Joined: Oct 23, 2007
@Freddy Wong : Thanks for the link. @Kelvin Lim: Thanks for the example. I got it now.