• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

built in Annotation doubt

 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried sample for built in Annotations



Source

As per the source this program will show compilation error, but it is not showing any error

Why it is not showing?
 
Campbell Ritchie
Sheriff
Pie
Posts: 50182
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reason you are getting an error is that you have not overridden the toString method, but have overloaded it. Look closely at the Object class.
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reason you are getting an error is that you have not overridden the toString method, but have overloaded it. Look closely at the Object class.


I am not getting error.I like to get error at this scenario.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The annotation is @Override (no 's' on the end)
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Joanne.It is Showing Error now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic