| Author |
Importance of @override annotation
|
Abiodun Adisa
Ranch Hand
Joined: Jan 17, 2002
Posts: 495
|
|
|
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
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16695
|
|
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.
Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32712
|
|
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.
|
 |
 |
|
|
subject: Importance of @override annotation
|
|
|