I thought that in any of these languages, comments are simply erased before the compilation...
It might seem so but, unfortunately, this harmless-looking Hello World
program wouldn't even compile.
Why? Because of a comment. The culprit is the path the source. Specifically, \users
. The backslash \
is followed by the letter u
, denotes the start of a Unicode escape. The trailing sers
makes it a ill-formed Unicode escape. (It would have been ok if \u
was followed by 4 hex digits -- yes, you need that even in a comment.)
As such, the code wouldn't even compile due to the comment.
public class HelloWorld {
/**
* Source: C:\users\devnull\HelloWorld.java
*/
public static void main(String[] args) {
System.out.println("Hello World!");
}
}