求教各位以下程序
public static void main(String args[])
{
short ShortMax = Short.MAX_VALUE;
short a =1;
System.out.println("Maximum of Short Is = "+ ShortMax+a);
}
输出结果是327671
public static void main(String args[])
{
short ShortMax = Short.MAX_VALUE;
short a =1;
System.out.println(ShortMax+a);
}
输出结果是32768
想问下以上两例为什么不会出现溢出?