Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #30903
| From | Lothar Kimmeringer <news200709@kimmeringer.de> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Co-/Contravariance and @Override... |
| Date | 2015-01-26 00:52 +0100 |
| Organization | Organization?! Only chaos here! |
| Message-ID | <b2zagkkh616k$.dlg@kimmeringer.de> (permalink) |
| References | <slrnmcacgg.uoi.avl@login.logic.tuwien.ac.at> |
Andreas Leitgeb wrote:
> class MyFoo extends MyBase implements Foo {
> @Override public void foo(CharSequence c) { ... }
> }
>
> For reasons I do not quite understand, eclipse complains about it.
> Eclipse claims that my foo method doesn't merit the @Override.
> Why not? Isn't it so, that subclasses can be more lenient about
> accepted types, as long as the inherited constraints are met?
You're not overwriting a method but implementing an interface,
so the Overwrite-annotation can't be used at all. Some versions
of Eclipse accept that, though.
Regards, Lothar
--
Lothar Kimmeringer E-Mail: spamfang@kimmeringer.de
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)
Always remember: The answer is forty-two, there can only be wrong
questions!
--- news://freenews.netfront.net/ - complaints: news@netfront.net ---
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Co-/Contravariance and @Override... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-01-25 18:12 +0000
Re: Co-/Contravariance and @Override... Lothar Kimmeringer <news200709@kimmeringer.de> - 2015-01-26 00:52 +0100
Re: Co-/Contravariance and @Override... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-01-26 01:52 +0000
Re: Co-/Contravariance and @Override... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-01-26 01:46 +0000
csiph-web