Question in Java

General Rules

  • This Forum Rules:
    1. No asking for course requests or download links.
    2. Don't share links to other websites for downloads or references.
    3. Avoid controversial topics in discussions.

    4. Use an appropriate thread title that matches your content, not just a word.

    Other Forum Rules Can Be Found Here

sameer13899

Member
TutFlixer
Dec 31, 2020
41
31
13
India
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.
 

Latest resources