转义字符
package lesson03;
public class DataDemo05 {
public static void main(String[] args) {
char ch1 = '\"'; //表示的是一个"
char ch2 = '\\'; //表示的是一个\
System.out.println("ch1 = " + ch1);
System.out.println("ch2 = " + ch2);
System.out.println("\"Hello World!\"");
}
}
运行结果:
ch1 = "
ch2 = \
"Hello World!"