Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why this gives me compiler error??

 
srikanth reddy
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


here i have commented the line then how come it give me an error ??
 
Roel De Nijs
Sheriff
Posts: 9929
113
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the symbol for the linefeed
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A frequently asked question: please search this forum or your Java book.
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,



This compiles fine..also the below one..





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


 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"/* ... */" 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
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks barry

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic