| Author |
Compile Time Constants...
|
Dan Silva
Ranch Hand
Joined: Sep 05, 2007
Posts: 86
|
|
|
What does it mean to be a compile time constant?
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
A compile time constant is one that can't be set or changed after compilation. Examples: The first is a compile time constant. The compiler knows that the value will be 1 and that it can never change. In the second example the assignment of SET_AT_RUNTIME is delayed until the construction of the class. The compiler has no idea what SET_AT_RUNTIME will be. In the third example the value depends on another class which could change after this class has been compiled so it isn't a compile time constant. [ March 01, 2008: Message edited by: Ben Souther ]
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Dan Silva
Ranch Hand
Joined: Sep 05, 2007
Posts: 86
|
|
|
Thanks!
|
 |
 |
|
|
subject: Compile Time Constants...
|
|
|