public class Multicast{
public static void main(String[] args){
System.out.println((int)(char)(byte) -1);
}
Solution:
显示:65535
byte到char的时候出现问题,byte是由符号的,而在char里是没有符号的。
}
TID:
the conversion from byte to char is not considered a widening primitive conversion,
but a widening and narrowing primitive conversion: Tye byte is converted to an int and th
int to a char.
Sign extension is performed if the type of the original value is signed; zero
extension if it is a char ,regardless of the type to which it is being.
If you can't tell what a program does by looking at it, it probably doesn't do what
you want.