存在,如 Integer.MAX_VALUE

package constxiong.interview;

/**
 * 测试最大值加1
 * @author ConstXiong
 */
public class TestMaxValueAddOne {

    public static void main(String[] args) {
        int i = Integer.MAX_VALUE;
        System.out.println(i+1<i);
        System.out.println(i+1);
    }
    
}

 

打印

true
-2147483648

 


  

 

  

来一道刷了进BAT的面试题?

相关文章:

  • 2021-12-11
  • 2022-02-18
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
猜你喜欢
  • 2021-11-22
  • 2022-12-23
  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
  • 2021-04-20
  • 2021-11-23
相关资源
相似解决方案