A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
Importance of @override annotation
Joined: Jan 17, 2002
Mar 09, 2009 12:02:28
Please can someone explain to me the importance of @override annotation because i can't really see its importance if we have a Class that contains a method that overrides another method in the super class, why the need for the @override annotation
Joined: Sep 28, 2004
Mar 09, 2009 12:45:56
It's great for catching spelling errors. For example, if you tried to override the hashCode() method, and accidently type hashcode() instead, the compiler will complain.
Java Threads, 3rd Edition
Jini in a Nutshell
Java Gems (contributor)
Joined: Oct 13, 2005
Mar 09, 2009 13:27:12
Henry Wong wrote:
It's great for catching spelling errors.
And it's got a spelling error in
It's @Override, not @override! Remember Java is case-sensitive, and the tiniest spelling error can cause no end of problems.
I agree. Here's the link:
subject: Importance of @override annotation
help needed on Inner classes program
Overriding vs. Overloading
What are Annotations ? Why do wee need them ?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014