67,513
社区成员
发帖
与我相关
我的任务
分享
public static void main(String[] args) {
BigDecimal A = BigDecimal.valueOf(10);
BigDecimal B = BigDecimal.valueOf(1);
BigDecimal subResult = A.subtract(B);
if (subResult.compareTo(BigDecimal.valueOf(2)) > 0) {
System.out.println(subResult + " is bigger than 2");
} else {
System.out.println(subResult + " is littler than 2");
}
}