aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes why this gives me compiler error?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "why this gives me compiler error??" Watch "why this gives me compiler error??" New topic
Author

why this gives me compiler error??

srikanth reddy
Ranch Hand

Joined: Jul 28, 2005
Posts: 252


here i have commented the line then how come it give me an error ??


Thanks & Regards<br /> <br />-Srikanth
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5207
    
  12

this is the symbol for the linefeed


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
A frequently asked question: please search this forum or your Java book.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Hi,



This compiles fine..also the below one..





The compiler is indeed parsing through the single line comment...


Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
"/* ... */" can be used for multiline comments so it does not matter if a linefeed is present between them.

"// ... " is for a single line comment so the linefeed has an impact on what the compiler sees on the next line.
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Thanks barry

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why this gives me compiler error??