compile-time evaluation of constant expressions

admin

Administrator
Staff member
Hello Java gurus.....Heres a question ...the excerpt is from the URL :http://domino.watson.ibm.com/syssftpr/JavaTech/Jikes.nsf/Named/SunQuery17If an expression is a compile-time constant (JLS 15.19, plus parenthesizedconstant expressions), a compiler _must_ have the value available atcompile-time (e.g. for determining definite assignment, reachability,assignment convertibility, and so forth).2. However, a compiler is allowed to _additionally_ compute the value atrun-time, basically because it is impossible for a Java program to "observe"whether a constant expression is evaluated once or several times (forexample, evaluating a constant expression can never throw an exception).Could someone explain what does " because it is impossible for a Javaprogram to "observe" whether a constant expression is evaluated once orseveral times " mean !!!ThanxDeepak
 
Back
Top