1

The below program compiled successfully and run without any errors. As per my understanding is should have thrown error in line 4. Can somebody explain?

class Test{
    public static void main(String args[]) {
        // my favorite website is
        http://www.stackoverflow.com/questions/ask
        System.out.println("hello world");
    }
}
Nakul Kumar
  • 170
  • 2
  • 11

1 Answers1

5

No, it's not an error, "http:" works here as the name of the label and "//" starts the comments which is ignored.

Zbynek Vyskovsky - kvr000
  • 18,186
  • 3
  • 35
  • 43