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


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

Re: another error with @Override with another code

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 "John B. Matthews" <nospam@nospam.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: another error with @Override with another code
Date Fri, 06 Dec 2013 11:29:39 -0500
Organization The Wasteland
Lines 43
Message-ID <l7su1k$njq$1@dont-email.me> (permalink)
References <d0685bbc-5d5d-47d0-a264-e79debf00b3d@googlegroups.com> <slrnla2tii.76o.fredrik@biggles.jonson.org> <52a1867c$0$2911$e4fe514c@news2.news.xs4all.nl> <796271a4-11a0-402c-85ff-0f91556c8e7a@googlegroups.com> <06afa354-5858-4359-9e29-6f2b1846e628@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Fri, 6 Dec 2013 16:29:40 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="d17dee34624b7b363488e8f2f4ab0076"; logging-data="24186"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Pfqgi3hlxAkdeg7HglKstwM/+xCShLf4="
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.1.1
In-Reply-To <06afa354-5858-4359-9e29-6f2b1846e628@googlegroups.com>
Cancel-Lock sha1:scQRXyjWZ2hFh0nqQJofgMvfVbA=
Xref csiph.com comp.lang.java.programmer:26753

Show key headers only | View raw


On 12/6/13, 10:25 AM, Y HA wrote:
> the same happens with this code :
[...]
> final class Override extends MyMethod {
>
>   @Override
>   public String engage() {
>     return this.str;
>   }
[...]
> }

In this example, the identifier Override used for the class name 
collides with the same identifier used for the annotation name. You can 
use the fully qualified name, @java.lang.Override, or rename the class.

public class MyMethod {

     private static final String str = "Philadephia";

     public void engage(String str) {
         System.out.println(str);
     }

     private static final class MyOverride extends MyMethod {

         @Override
         public void engage(String str) {
             super.engage(str);
         }

         public static void main(String[] args) {
             MyOverride mo = new MyOverride();
             mo.engage(str);
         }
     }
}


-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

@override annotation not working correctly javac version _ 1.7.0_25 Y HA <yuriha@gmail.com> - 2013-12-05 14:42 -0800
  Re: @override annotation not working correctly javac version _ 1.7.0_25 Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-12-05 18:25 -0500
    Re: @override annotation not working correctly javac version _ 1.7.0_25 Y HA <yuriha@gmail.com> - 2013-12-05 16:13 -0800
      Re: @override annotation not working correctly javac version _ 1.7.0_25 Y HA <yuriha@gmail.com> - 2013-12-05 17:00 -0800
      Re: @override annotation not working correctly javac version _ 1.7.0_25 Y HA <yuriha@gmail.com> - 2013-12-05 17:03 -0800
        Re: @override annotation not working correctly javac version _ 1.7.0_25 Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-12-05 20:42 -0500
          Re: @override annotation not working correctly javac version _ 1.7.0_25 Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2013-12-07 19:15 +0000
  Re: @override annotation not working correctly javac version _ 1.7.0_25 "John B. Matthews" <nospam@nospam.invalid> - 2013-12-05 21:49 -0500
  Use of @Override when implementing interfaces (was: @override annotation not working...) Fredrik Jonson <fredrik@jonson.org> - 2013-12-06 07:01 +0000
    Re: Use of @Override when implementing interfaces Silvio <silvio@internet.com> - 2013-12-06 09:10 +0100
      Re: Use of @Override when implementing interfaces Y HA <yuriha@gmail.com> - 2013-12-06 07:08 -0800
        another error with @Override  with another code Y HA <yuriha@gmail.com> - 2013-12-06 07:25 -0800
          Re: another error with @Override  with another code "John B. Matthews" <nospam@nospam.invalid> - 2013-12-06 11:29 -0500
            Re: another error with @Override  with another code Y HA <yuriha@gmail.com> - 2013-12-06 09:21 -0800
              Re: another error with @Override  with another code "John B. Matthews" <nospam@nospam.invalid> - 2013-12-07 00:26 -0500
                Re: another error with @Override  with another code Knute Johnson <september@knutejohnson.com> - 2013-12-06 21:57 -0800
                Re: another error with @Override  with another code Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-12-07 08:44 -0500
              Re: another error with @Override  with another code "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2013-12-07 11:12 +0000
        Re: Use of @Override when implementing interfaces Stanimir Stamenkov <s7an10@netscape.net> - 2013-12-07 16:32 +0200
          Re: Use of @Override when implementing interfaces Y HA <yuriha@gmail.com> - 2013-12-08 12:02 -0800
            Re: Use of @Override when implementing interfaces Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2013-12-08 21:27 +0000
              Re: Use of @Override when implementing interfaces Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2013-12-08 23:43 +0000
            Re: Use of @Override when implementing interfaces Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-12-08 16:45 -0500
    Re: Use of @Override when implementing interfaces Jeff Higgins <jeff@invalid.invalid> - 2013-12-06 09:51 -0500
    Re: Use of @Override when implementing interfaces leif.roar@invalid.com (Leif Roar Moldskred) - 2013-12-06 09:36 -0600
      Re: Use of @Override when implementing interfaces Y HA <yuriha@gmail.com> - 2013-12-06 07:41 -0800
      Re: Use of @Override when implementing interfaces markspace <markspace@nospam.nospam> - 2013-12-06 08:18 -0800
    Re: Use of @Override when implementing interfaces v_borchert@despammed.com (Volker Borchert) - 2013-12-07 07:14 +0000
      Re: Use of @Override when implementing interfaces Wayne <nospam@all.invalid> - 2013-12-07 04:46 -0500
        Re: Use of @Override when implementing interfaces v_borchert@despammed.com (Volker Borchert) - 2013-12-07 10:54 +0000
      Re: Use of @Override when implementing interfaces Fredrik Jonson <fredrik@jonson.org> - 2013-12-09 12:59 +0000
    Re: Use of @Override when implementing interfaces Arne Vajhøj <arne@vajhoej.dk> - 2013-12-09 21:06 -0500
      Re: Use of @Override when implementing interfaces "John B. Matthews" <nospam@nospam.invalid> - 2013-12-11 00:55 -0500

csiph-web