Do I need to put @Override annotation when I implement an interface (not override an abstract class)?
And what does @Override annotation achieve?
In Java 5, you must not add @Override when implementing a method inherited from an interface, in Java 6, you should (or you'll get a compiler warning).
@Override asserts that a method is intended to override something, and will cause the compiler to notify you should this not or no longer be the case, for instance because the method you are overriding has been renamed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With