I have a class structure such as following for storing static final constants:
public final class A{
//..list of constants
public final class B{
//..list of constants
public final class C{
// ..list of constants
}
}
}
If I need to access static constants of class C(say about 10 to them) in some thread, which of the two approaches is better(faster)? Does it even make a difference? Is this some optimization that is VM specific? I am running this code on Android platform:
void doIt(){
A.B.C temp;
S.O.P(temp.FIELD1);
S.O.P(temp.FIELD2);
...
S.O.P(temp.FIELD10);
}
//OR
void doIt(){
S.O.P(A.B.C.FIELD1);
S.O.P(A.B.C.FIELD2);
...
S.O.P(A.B.C.FIELD10);
}