Results 1 to 2 of 2
- 08-06-2007, 06:32 PM #1
Member
- Join Date
- Aug 2007
- Posts
- 2
- Rep Power
- 0
- 08-06-2007, 07:13 PM #2levent Guest
If you want that variable to be read only define it like this:
And if you want it to be writable by other classes, then define it like this:Java Code:public static final int myGlobalVariable = 10;
And if you want it to be visible by just the classes (or files) in the same package, make it protected.Java Code:public static int myGlobalVariable = 10;
Similar Threads
-
File Access Through Servlets
By bipinkrishna15 in forum Java ServletReplies: 1Last Post: 05-27-2008, 10:58 AM -
how to access shared file/folder in LAN
By ksheetiz in forum NetworkingReplies: 1Last Post: 05-24-2008, 04:54 AM -
Need help on a strange file access prob
By squad in forum Advanced JavaReplies: 0Last Post: 03-21-2008, 10:55 AM -
Access a variable
By Eric in forum New To JavaReplies: 2Last Post: 07-04-2007, 08:29 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks