File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Storing static constants" Watch "Storing static constants" New topic

Storing static constants

charishma gottumukkula

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

Joined: May 26, 2003
Posts: 32811

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.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Storing static constants
It's not a secret anymore!