View Single Post
  #2 (permalink)  
Old 08-06-2007, 08:13 PM
levent levent is offline
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
If you want that variable to be read only define it like this:

Code:
public static final int myGlobalVariable = 10;
And if you want it to be writable by other classes, then define it like this:

Code:
public static int myGlobalVariable = 10;
And if you want it to be visible by just the classes (or files) in the same package, make it protected.
Reply With Quote