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 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: References: 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 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 ---