USE INTERFACES FOR SIMPLE ACCESS TO CONSTANTS Many Java applications utilize class fields declared as static final as constants. However, it can sometimes be burdensome to repeatedly write out the full name of a constant with its class reference. By declaring constant fields in an interface, other classes can implement the interface to access the constant fields directly. The example below demonstrates how to declare constant fields in an interface: public class interface Constants { public static final int MY_CONSTANT = 0; public static final String MY_NEXT_CONSTANT = "constant"; } Technically, the public static final declarations are redundant, as interface fields implicitly include those declarations, but explicit declarations are useful reminders of what's going on internally. To use these constants in a class, just add the Constants interface to the class as is done here: public class constantsUser implements Constants { public constantsUser(int param) { if(param == MY_CONSTANT) { //do stuff... } } } Many developers capitalize static final field names to differentiate them visually from local or class variables. Since Java's variable names are case-sensitive, capitalizing constants also reduces the likelihood of namespace collisions. Other developers prefer using prefixes or suffixes to differentiate constants - the important thing is to be consistent. Of course, your application can always refer to your interface fields using their fully qualified names like Constants.MY_CONSTANT if you don't want to add the interface to a particular class or if the interface's field name conflicts with other names used in the implementing class. Using interfaces instead of classes to declare your application's constants is a simple way to save yourself a little time and effort. ------------------------------------------