Java and Url in the Code

Hey, a nother funny fact about java
How thinks the code below will compile?

public static void main(String[] args)
{
http://www.ribalba.de/
System.out.println("Hello World");
}
It does. This is due to the : and the //
In Java you can have a label so the goto can work. This is defined through the : everything after this is seen as a comment because of the //
=> So you can post urls in your code where you want and javac will just ignore them

1 comment:

Anonymous said...

People should read this.