• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

basic doubt....

 
CAAnitha Ramesh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am new to this forum. I happened to come acroos the below code snippet and tried executing it.

class sample {
public static void main(String[] args) {
System.out.print("iexplore pen");
http://www.google.com;
System.out.println(":maximise");
}
}

It is compiling successfully and the output is normal. How does this compile?? How does JVM interpret the http statement?? Any significant reason that this sort of statement is allowed in the middle of the program??

Please note that the above code snippet does not compile if you remove the last print statement, I mean, leaving the http statement as the last statement.

Thanks and regards,
Anitha
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While this is valid, it is almost completely useless and certainly a bad idea.

It is made up of two parts: a label and a line comment eg

http:
//google.com

While labels and comments are valid, using them to display URLs is misleading and not useful.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic