数字基本类型short、byte、int的赋值与比较
数字基本数据类型赋值与比较
//byte y = 128;编译错误
byte j = 127;//编译通过
byte x = (byte)(127+1);//编译通过
byte g = 1+1;//编译通过
//byte h = 139+1;编译错误
short i1 = 127;
System.out.println(j==i1); //true
//byte y = 128;编译错误
byte j = 127;//编译通过
byte x = (byte)(127+1);//编译通过
byte g = 1+1;//编译通过
//byte h = 139+1;编译错误
short i1 = 127;
System.out.println(j==i1); //true