0
点赞
收藏
分享

微信扫一扫

IntOverflowDemo


package com.shrimpking.t1;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Shrimpking
 * @create 2024/9/14 18:43
 */
public class IntOverflowDemo
{
    public static void main(String[] args)
    {
        int max = Integer.MAX_VALUE;
        int min = Integer.MIN_VALUE;

        System.out.println("int Max=" + max);
        System.out.println("int Min=" + min);

        System.out.println("Max overflow=" + (max + 1)); //溢出
        System.out.println("Min overflow=" + (min - 1)); //溢出

    }
}

举报
0 条评论