字符型(char)变量
字符型(char)常量
char
在Java中注意字符和字符串的区别
特点:
占用两个字节
使用Unicode编码表进行编码
可允许有65536个字符,包含汉字
用单引号表示字符
实例:
/**
* TestPrimitiveDateType
* @author Lucifer
*/
public class TestPrimitiveDate_TypeNo3 {
public static void main(String arguments[]){
char first = ‘T‘;
char second = ‘俊‘;
System.out.println(first);
System.out.println(second);
char c = ‘\u0061‘;
System.out.println(c);
}
}
原文:https://www.cnblogs.com/JunkingBoy/p/14584947.html