Page 1 of 1

@Override annotation @ run() method

Posted: Tue Jun 28, 2011 5:51 pm
by Starter
Hey guys,

I got a general question why its more and more the case that the @Override annotation is more and more used at the run() method.

At first I thought that its better to do this and since its a new feature to do this it can only be good but I found out that its kinda useless at the end especially to add this annotation on interface implementation since its inconsistent since there is no such thing as "overriding an interface" in java / interface implementation is useless since in practise it catches no bugs that the compilation wouldn't catch anyway. There is only one, far fetched scenario where override on implementers actually does something: If you implement an interface, and the interface REMOVES methods, you will be notified on compile time that you should remove the unused implementations. Notice that if the new version of the interface has NEW or CHANGED methods you'll obviously get a compile error anyways as you're not implementing the new stuff.

So why its done? Only because one or several devs have that feature in their IDE enabled? Its more "code" for nothing at the end..

Re: @Override annotation @ run() method

Posted: Tue Jun 28, 2011 9:17 pm
by Stake
Yes, first it's needed for IDE, second, interface polymorphism is just the same like any other. Every method overrides the interface's virtual "null" or "abstract" methods. So basically this is an override.

Re: @Override annotation @ run() method

Posted: Tue Jun 28, 2011 11:09 pm
by JIV
i dont share this new attitude putting over interface implementation method @Override annotation, its just totally useless and misleading. I think it just should be some other annotation, not same.