Identifier Ignorable characters in keywords and literals

Pravin Jain pravin at zensoftech.co.in
Tue Sep 22 05:39:18 UTC 2020


Hello,

The following code compiles and executes successfully.

public cl\u0001ass Identifier\u0002Ignorable {
    public sta\u0003tic vo\u0004id ma\u0005in(String[] args) {
        System.out.println("Hello world");
    }
}

The JLS mentions about the use of Identifier-Ignorable characters
being allowed in an Identifier, but using those in a keyword, or
literal has not been mentioned. From the specification, one does not
gather that these characters will be ignored when used inside a
keyword or a literal. Is this error of compiler or the JLS has missed
to clarify this point?

Thanks and Regards,
Pravin Jain
+91-94260 54269


More information about the compiler-dev mailing list