Gooberlx2 Lifer May 4, 2001 15,381 6 91 Oct 30, 2002 #3 yes. Make a constants class and declare only your vars (no methods). public static final int BLAH_BLAH = 000; Sure, it violates like every rule as far as variable/class access goes, but no one change them anyway since they're final.
yes. Make a constants class and declare only your vars (no methods). public static final int BLAH_BLAH = 000; Sure, it violates like every rule as far as variable/class access goes, but no one change them anyway since they're final.
Gooberlx2 Lifer May 4, 2001 15,381 6 91 Oct 30, 2002 #4 oh yeah, then access them via dot-notation something like: for( int i=0; i < MyContants.BLAH_BLAH; i++) { // some code here }
oh yeah, then access them via dot-notation something like: for( int i=0; i < MyContants.BLAH_BLAH; i++) { // some code here }
A Alex Diamond Member Oct 26, 1999 6,995 0 0 Oct 31, 2002 #5 Originally posted by: Gooberlx2 oh yeah, then access them via dot-notation something like: for( int i=0; i < MyContants.BLAH_BLAH; i++) { // some code here } Click to expand... we haven't learned that yet but i can see how that works... sweet! edit: boo for K&R notation
Originally posted by: Gooberlx2 oh yeah, then access them via dot-notation something like: for( int i=0; i < MyContants.BLAH_BLAH; i++) { // some code here } Click to expand... we haven't learned that yet but i can see how that works... sweet! edit: boo for K&R notation