public class Constants {
// This is a constant for sure!
public static final int NUMBER1 = 42;
// This is a constant.
public static final Integer NUMBER2 = 42;
// Is this really a constant?
public static final BigInteger NUMBER3 = new BigInteger("42");
}
定数は必ずプリミティブ [ NUMBER1
] (またはプリミティブ ラッパー [ NUMBER2
]) でなければなりませんか、それともstatic final
フィールドを定数 [ NUMBER3
] と見なすだけで十分ですか?