The following code doesn't get compiled.
class backslash
{
public static void main(String args[]){
System.out.println("\u005c");
}
}
backslash.java:4: String not terminated at end of line.
System.out.println("\u005c");
^
backslash.java:5: ')' expected.
}
^
2 errors
When "\u005c" is parsed by the compiler, it assumes that "\" translated from
\u005c is escape backslash and treat the following " as just single character rather than string termination sign.
class backslash
{
public static void main(String args[]){
System.out.println("\u005c");
}
}
backslash.java:4: String not terminated at end of line.
System.out.println("\u005c");
^
backslash.java:5: ')' expected.
}
^
2 errors
When "\u005c" is parsed by the compiler, it assumes that "\" translated from
\u005c is escape backslash and treat the following " as just single character rather than string termination sign.