Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in Code

 
Indu Acharya
Greenhorn
Posts: 27
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Getting below mentioned error when I copied the below code and pasted in eclipse.

"Syntax error on tokens,deete these tokens"

I do not see any problem in the code.


but I am not getting any error when I type the code in eclipse.

PS: I copied the code (inside code tags) from here (in Preview mode) and pasted in Eclipse, I don't see any error now.

Can anyone tell me what was the problem I was facing.

I have attached the screenshot of error.


Screenshot-(195).png
[Thumbnail for Screenshot-(195).png]
Screenshot shows error
 
Liutauras Vilda
Bartender
Pie
Posts: 2803
112
BSD VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe syntax error on line 3, which is hidden with tooltip in your provided image. However, move onto the next chapters, don't waste time, this code is fine.

And use combination of next 3 keystrokes to format and indent the code. Windows keyboard ctrl + shift + f macbook keyboard cmd + shift + f.
 
Narayana Bojja
Ranch Hand
Posts: 135
4
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Clean Project in eclipse when you face such kind of errors
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately a tooltip is covering a part of the code, so it's very hard to tell what's wrong. The code in your first post is perfectly fine and will compile successfully.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Narayana Bojja wrote:Clean Project in eclipse when you face such kind of errors

Using command line javac (and java) is even better
 
Indu Acharya
Greenhorn
Posts: 27
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the code without tooltip. I wanted to show the error that covered the line 3.


Liutauras - I wanted to know what was wrong so that it would be helpful in future when I face same error.
Screenshot-(196).png
[Thumbnail for Screenshot-(196).png]
 
Liutauras Vilda
Bartender
Pie
Posts: 2803
112
BSD VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Indu Acharya wrote:Liutauras - I wanted to know what was wrong so that it would be helpful in future when I face same error.
In the future you most likely will know what to do (there is nothing wrong with code, at least I don't see it now). Problems probably could be solved by rebuilding or update'ing project (by clicking right mouse button on the specific project you'd find such option.

In the meantime, since you're getting ready for the certification, Roel gave you a very valid advice - use command line compiler. This is what mots of the certification preparation books advice, don't they? Eclipse highlighting you errors, while nobody during the exam will do that - so better train your eyes using simple text editor with no help and command line compiler, which can be invoked from the console:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic