Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Knute Johnson Newsgroups: comp.lang.java.programmer Subject: Re: another error with @Override with another code Date: Fri, 06 Dec 2013 21:57:20 -0800 Organization: A noiseless patient Spider Lines: 49 Message-ID: References: <52a1867c$0$2911$e4fe514c@news2.news.xs4all.nl> <796271a4-11a0-402c-85ff-0f91556c8e7a@googlegroups.com> <06afa354-5858-4359-9e29-6f2b1846e628@googlegroups.com> <33f33be7-61be-411f-9dee-704118dfb44f@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 7 Dec 2013 05:57:18 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="aba33539224e5c782fe0c4053f7756fd"; logging-data="18880"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Jojt0gQZ0NzESgO59uVr2" User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 In-Reply-To: Cancel-Lock: sha1:p/jSI9XaCpyY3pHpwOCT6OChb5w= Xref: csiph.com comp.lang.java.programmer:26757 On 12/6/2013 9:26 PM, John B. Matthews wrote: > On 12/6/13, 12:21 PM, Y HA wrote: >> got this error with this code which also uses @Override >> >> # javac MySuperClass.java >> MySuperClass.java:11: error: incompatible types >> @Override >> ^ >> required: Annotation >> found: Override >> 1 error >> >> >> >> public class MySuperClass { >> >> public void doTheThing() { >> System.out.println("Do the thing"); >> } >> } >> >> >> class MySubClass extends MySuperClass{ >> >> @Override >> public void doTheThing() { >> System.out.println("Do it differently"); >> } >> } > > I see no error on the platform cited up-thread. You may have > adventitious classes in the classpath. Start with a clean build; failing > that, scrutinize your IDE's cache and your platform's java.ext.dirs. > My mother always said if I hung out with the smart kids, I might just learn some new vocabulary. ad·ven·ti·tious [ad-vuhn-tish-uhs] Show IPA adjective 1. associated with something by chance rather than as an integral part; extrinsic. -- Knute Johnson