为什么在允许某些Unicode字符的注释中执行Java代码?
问题: The following code produces the output "Hello World!" 以下代码生成输出“Hello World!” (no really, try it). (不,真的,试试吧)。 public static void main(String... args) { // The comment below is not a typo. // \u000d System.out.println("Hello World!"); } The reason for this is that the Java compiler parses the Unicode character \ as a new line and gets transformed into: 原因是Java编译器将Unicode字符 \ 解析为新行并转换为: public static void main(String... args) { // The comment below is not a typo. // System.out.println("Hello World!"); } Thus resulting into a comment being "executed". 从而导致评论被“执行”。 Since this can be used to