Q:

Why doesn't putting a random http link in code cause a compilation error?

For example:
public class MyLink{

    public static void main(String[] args) {
        http://google.com

        System.out.println("And this works!");
    }
}

This code will compile without any problems. Why?

A:

Java interprets http: as a label, and the rest of the line is a comment.

A:

In Java http: is a label which you can use in loops or any pther statements, whereas //google.com is a single-line comment.

