I am not getting the explanation, please someone explain me in simpler terms. Thanks !
Source : StackOverflow
public class Main {
public static void main(String[] args) {
// \u000d System.out.println("Hello");
}
}
It will print "Hello".
Explanation :
Java parses character escape codes in source code, not just strings.
This allows you to use Unicode identifiers without a Unicode encoding.
Therefore, the \u000d in the comment is parsed as a newline, ending the comment and beginning an instance initializer.
Source : StackOverflow
public class Main {
public static void main(String[] args) {
// \u000d System.out.println("Hello");
}
}
It will print "Hello".
Explanation :
Java parses character escape codes in source code, not just strings.
This allows you to use Unicode identifiers without a Unicode encoding.
Therefore, the \u000d in the comment is parsed as a newline, ending the comment and beginning an instance initializer.