Long类型比较
结论:用equals比较
public static void main(String[] args) {
Long aLong = 1000L;
Order order = new Order();
order.setOrderId(1000L);
System.out.println(aLong == order.getOrderId());//false
System.out.println(aLong == order.getOrderId().longValue());//true
System.out.println(1000L == order.getOrderId());//true
System.out.println(order.getOrderId().equals(aLong));//true
System.out.println(order.getOr
Long类型比较最先出现在Python成神之路。
共有 0 条评论