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
]?