Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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


Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
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: 6297
    
  22

this is the symbol for the linefeed


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
OCAJP 7
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: 980
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: 980
Thanks barry

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