Let’s have a look at the following Java code.
public class Main
{
public static void main(String[] args)
{
//\u000d System.out.println("It works fine.");
}
}
In the preceding code snippet, the only line inside the main() method contains a unicode new line character, \u000d . It displays the specified message “It works fine.” even though that line is commented out. How does it work?
A little-known feature of the Java language is that Unicode escape sequences are processed anywhere in source code, before any other parsing.
That’s a real newline.
You can even write an entire Java program out of nothing but escape codes.