01.代码如下:



package TIANPAN;

/**
* 此处为文档注释
*
*/
public class TestDemo {
public static void main(String[] args) {
int num = 130; // 此范围超过了byte定义
byte x = (byte) num; // 由int变为byte
System.out.println(x);
}
}


02.效果如下:

013、Java中int类型转换byte_二维码