Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #26734
| X-Received | by 10.58.54.97 with SMTP id i1mr43047vep.40.1386283373323; Thu, 05 Dec 2013 14:42:53 -0800 (PST) |
|---|---|
| X-Received | by 10.50.143.105 with SMTP id sd9mr8162igb.3.1386283373270; Thu, 05 Dec 2013 14:42:53 -0800 (PST) |
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!p15no6663933qaj.0!news-out.google.com!9ni1945qaf.0!nntp.google.com!bm17no14997992qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.java.programmer |
| Date | Thu, 5 Dec 2013 14:42:52 -0800 (PST) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=201.152.52.106; posting-account=eSJL5woAAACZ9AofZY6xBvE-6Mv_qhCa |
| NNTP-Posting-Host | 201.152.52.106 |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <d0685bbc-5d5d-47d0-a264-e79debf00b3d@googlegroups.com> (permalink) |
| Subject | @override annotation not working correctly javac version _ 1.7.0_25 |
| From | Y HA <yuriha@gmail.com> |
| Injection-Date | Thu, 05 Dec 2013 22:42:53 +0000 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-Received-Bytes | 2242 |
| X-Received-Body-CRC | 3115198754 |
| Xref | csiph.com comp.lang.java.programmer:26734 |
Show key headers only | View raw
Hi!
This code should output:
Run method overridden in Task class
overridden method run() in PeriodicTask class
but I'm having this :
# javac -version
javac 1.7.0_25
# javac CollectionTest.java
CollectionTest.java:18: error: incompatible types
@Override
^
required: Annotation
found: Override
CollectionTest.java:27: error: incompatible types
@Override
^
required: Annotation
found: Override
2 errors
/**
* Java program to demonstrate how to override method in Java.
* Overridden method are resolved during runtime based upon type of object
* @author Javin
*/
public class CollectionTest {
public static void main(String args[]) {
Runnable task = new Task();
task.run(); //call overridden method in Task
task = new PeriodicTask();
task.run(); //calls overridden method in PeriodicTas
}
}
class Task implements Runnable{
@Override
public void run() {
System.out.println("Run method overridden in Task class");
}
}
class PeriodicTask extends Task{
@Override
public void run() {
System.err.println("overridden method run() in PeriodicTask class");
}
}
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll 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