do you recommend that we define some constant to be 256 (the size of the ascii character set)? or can we just hard code 256 in to our program.
also, where is the best place to put a constant field that you will need to use throughout the entire program? is it bad practice to say, make a class called "MyConstants" with nothing but a bunch of "public static final" variables and then just do stuff (all throughout the program) like:
for (i = 0; i < MyConstants.ASCII_CHARSET_SIZE; i ++) {
...
};
would referencing a constant member of a class have any impact on speed, or is the java compiler smart enough to optimize that?
is there any way to declare a bunch of global constants that aren't a member of any class in a file?
thanks,
jason
|