1、char占用两个字节
2、char的取值范围是[0 ~ 65535]
3、char采用unicode编码方式
4、char类型的字面量采用单引号括起来
package com.bjpowernode.controller;
public class Demo1 {
public static void main(String[] args) {
//正确
char c1 = '中';
//正确
char c2 = 'a';
//错误:cannot convert from String to char
char c3 = "中";
//错误: 未结束的文字字符
char c4 = 'ad';
}
}