Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #30903

Re: Co-/Contravariance and @Override...

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!goblin3!goblin.stu.neva.ru!news.netfront.net!not-for-mail
From Lothar Kimmeringer <news200709@kimmeringer.de>
Newsgroups comp.lang.java.programmer
Subject Re: Co-/Contravariance and @Override...
Date Mon, 26 Jan 2015 00:52:48 +0100
Organization Organization?! Only chaos here!
Lines 25
Message-ID <b2zagkkh616k$.dlg@kimmeringer.de> (permalink)
References <slrnmcacgg.uoi.avl@login.logic.tuwien.ac.at>
Reply-To news@kimmeringer.de
NNTP-Posting-Host 93.133.70.126
Mime-Version 1.0
Content-Type text/plain; charset="us-ascii"
Content-Transfer-Encoding 7bit
X-Trace adenine.netfront.net 1422229967 96334 93.133.70.126 (25 Jan 2015 23:52:47 GMT)
X-Complaints-To news@netfront.net
NNTP-Posting-Date Sun, 25 Jan 2015 23:52:47 +0000 (UTC)
User-Agent 40tude_Dialog/2.0.15.1de
Xref csiph.com comp.lang.java.programmer:30903

Show key headers only | View raw


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


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