Java 列舉Enum中若要放BigDecimal的寫法如下
import java.math.BigDecimal;
public enum MyEnum {
enum1(new BigDecimal("999999999.9999"));
private BigDecimal bigNum;
private MyEnum(BigDecimal bigNum){
this.bigNum = bigNum;
}
}
沒有留言:
張貼留言