int a = -5; byte b = (byte) a; System.out.println(b); //result: -5; int型数据能表示负数,与其底层机器级表示是一致的,它的字节编码也是-5。