By the way, I finally got the singleton solution working. Thanks Cornix!
//singleton class for holding global variables
class Globals {
// setup singleton instance
private static Globals singleton;
int[] attributesPrelim = {0, 0, 0, 0};
int[] attributesFinal = {2, 2, 2, 2};
public final int TOTAL_ATTRIBUTE_VALUES;
// constructor
private Globals( ) {
//set global constants
TOTAL_ATTRIBUTE_VALUES = getTotalAttributes( );
}
private int getTotalAttributes( ){
int totalAttributes = 0;
for( int value : attributesFinal ) {
totalAttributes += value;
}
return totalAttributes;
}
//public access methods
public static Globals getSingleton( ) {
if(singleton == null) {
singleton = new Globals( );
}
return singleton;
}
}
Consider this thread double solved, then.