This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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: //;
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="" target="_blank" rel="nofollow"></a>
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Why this code compiles fine?
It's not a secret anymore!