问题描述
The following is a quote:
"Now is the time
for all "good" men
to come to the
aid of their party"
public class Quote {
public static void main(String arg[]) {
System.out.println("The following is a quote:\n\"Now is the time\nfor all\"good\"men\ntocome to the\naid of their party\"");
}
}
解决方法
您可以这样做-
System.out.println("The following is a quote:\n"+"now is the time\nfor all \"good\" men \nto come to the\naid of their party");
输出:
The following is a quote:
now is the time
for all "good" men
to come to the
aid of their party
System.out.println("The following is a quote:\nnow is the time for all \"good\" men to come to the aid of their party");
输出-
The following is a quote:
now is the time for all "good" men to come to the aid of their party
在Java中,您可以使用\
示例-System.out.println("This is \"10\"");
要打印"
,请使用\
之类的\"