Why annotation @Override is needed when you redefine (or realize) methods?
The predefined @Override annotation is used to detect logical errors during the compilation. In this annotation is desirable to mark each method that will override a method from a superclass or implement a method from the interface. If in a superclass or in the interface, there is no method with the same signature, there is a compilation error. This makes it easy to identify situations where a superclass or interface has been removed or altered signature overlapped method.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Sign Up Now
or Subscribe for future quizzes