wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Why this code compiles fine? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Why this code compiles fine? " Watch "Why this code compiles fine? " New topic

Why this code compiles fine?

Hemang Thanki

Joined: Jan 24, 2005
Posts: 18
public class Curiosity {
public static void main (String[]args){
System.out.println ("A curiosity");
http: //www.something.com/howto.html;
System.out.println ("compile and run Ok!");
if we take // as comments, what about "http:" ?

why does not compiler throw an error that No symbol found http: ?

Oh great i got it now...

But let it be with this forum. This question should be in SCJP.

It takes http: as the label name...and rest is comment. Gr8...

Oh I Love you Java...ummmah

Petr Blahos
Ranch Hand

Joined: Apr 28, 2004
Posts: 131

is a label.


Get a better web browser:<br /><a href="http://www.mozilla.org/products/firefox/switch.html" target="_blank" rel="nofollow">http://www.mozilla.org/products/firefox/switch.html</a>
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Why this code compiles fine?
Similar Threads
why is defult package use discouraged in eclipse
how to speed up Java program?
harry potter 7 - part 1
Overriding private functions
question 1