public class HelloWorld {
public static void main(String[] args) {
String name = "盖伦";
char a= 'c';
//以下是转义字符
char tab = '\t'; //制表符
char carriageReturn = '\r'; //回车
char newLine = '\n'; //换行
char doubleQuote = '\"'; //双引号
char singleQuote = '\''; //单引号
char backslash = '\\'; //反斜杠
}
}
详细内容见网站:http://how2j.cn/k/variable/variable-literals/515.html