java byte和char

public static void main(String[] args) {
/*
* 1.'中'是字符,'中国'不是字符
* 2.'中'中文字符占两个字节,'a'英文字符占一个字节
* 3.char 占用两个字节
* 4.byte 占用一个字节
*/
byte a1 = 'b';// true byte 占用一个字节 'b'字符也占用一个字节
byte a2 = '中';//false '中'占用两个字节
char a4 = '张';//true
int a3 = '中';//true int占用四个字节而'中'占两个字节
}

原文地址:https://www.cnblogs.com/ZL0508/p/7089144.html