This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Complile time constant expression. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Complile time constant expression." Watch "Complile time constant expression." New topic

Complile time constant expression.

Mathangi Shankar
Ranch Hand

Joined: Nov 01, 2004
Posts: 56
Hi All,

I have been hearing the word compile time constant expression many a times.Can anybody share examples on this?

Like which is a compile time constant expression and which is not...



--------------------------------<br />SCJP1.4
prajkta patil
Ranch Hand

Joined: Nov 13, 2004
Posts: 49
"the final variables which r defined at the time of declaration " are the compile time constant expression.for example-
class abc{
final int i=3;
in this compiler gets the value of variable i at the time of compilation which is constant so that compiler can use the compile time constant value(i=3) in other expressions for calculations at compile time.
It is sorta covered in the JavaRanch Style Guide.
subject: Complile time constant expression.
It's not a secret anymore!