This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Storing static constants Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Storing static constants" Watch "Storing static constants" New topic
Author

Storing static constants

charishma gottumukkula
Greenhorn

Joined: Nov 06, 2006
Posts: 20
In J2EE, what is the best approach to store static constants?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30146
    
150

Same as Java:
public static final String CONST = "constant";

As far as I know, it's ok to use true hard coded constants. It just so happens that you may have multiple copies - for the different JVMs.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Storing static constants
 
Similar Threads
final static int i =0 Whizlabs says i is variable and i feel it is a constant
Is a CONSTANT to be both final and static?
oo design
Can i use "static" variable as parameters?
Are instances of enums static by default?