Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #13481
| Path | csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | markspace <-@.> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: [foo.bar.Frame] can not inherit from [java.awt.Frame] |
| Date | Wed, 11 Apr 2012 08:24:28 -0700 |
| Organization | A noiseless patient Spider |
| Lines | 23 |
| Message-ID | <jm47nd$6en$1@dont-email.me> (permalink) |
| References | <8d7bedc4-30a8-4dc4-97b6-9ddaafc2e16a@l4g2000vbt.googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Wed, 11 Apr 2012 15:24:29 +0000 (UTC) |
| Injection-Info | mx04.eternal-september.org; posting-host="QNqT5u6Ryx/DB+LpnoCWdQ"; logging-data="6615"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19FVGR9DnERxoBd45hBa5Tzz0Ui6SQsDGs=" |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 |
| In-Reply-To | <8d7bedc4-30a8-4dc4-97b6-9ddaafc2e16a@l4g2000vbt.googlegroups.com> |
| Cancel-Lock | sha1:0ZWnwnVXiozRVS/lad5J0JSwLZc= |
| Xref | csiph.com comp.lang.java.programmer:13481 |
Show key headers only | View raw
On 4/11/2012 4:56 AM, Maciej Labanowicz wrote:
> Frame.java:2: error: foo.bar.Frame is already defined in this
> compilation unit
I *think* what the compiler is saying using Frame as an unqualified name
collides with the existing foo.bar.Frame usage.
The solution is just to not use the "import" statement.
package quicktest;
class Frame extends java.awt.Frame {
public static final long serialVersionUID = 1L;
public static void main(String [] args) {
System.out.println("HELLO: args = " + args);
}
}
If your compiler can find "import java.awt.Frame", then it can find
java.awt.Frame without the import. You don't need import, it just
allows you to shorten the FQN to just the class name.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[foo.bar.Frame] can not inherit from [java.awt.Frame] Maciej Labanowicz <m.labanowicz@gmail.com> - 2012-04-11 04:56 -0700
Re: can not inherit from [java.awt.Frame] Paul Cager <paul.cager@googlemail.com> - 2012-04-11 05:51 -0700
Re: can not inherit from [java.awt.Frame] Lew <noone@lewscanon.com> - 2012-04-11 08:13 -0700
Re: can not inherit from [java.awt.Frame] Paul Cager <paul.cager@googlemail.com> - 2012-04-11 09:37 -0700
Re: [foo.bar.Frame] can not inherit from [java.awt.Frame] Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-04-11 12:59 +0000
Re: [foo.bar.Frame] can not inherit from [java.awt.Frame] markspace <-@.> - 2012-04-11 08:24 -0700
Re: [foo.bar.Frame] can not inherit from [java.awt.Frame] Patricia Shanahan <pats@acm.org> - 2012-04-11 09:34 -0700
Re: [foo.bar.Frame] can not inherit from [java.awt.Frame] markspace <-@.> - 2012-04-11 10:01 -0700
Re: [foo.bar.Frame] can not inherit from [java.awt.Frame] Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-04-11 11:18 -0700
Re: [foo.bar.Frame] can not inherit from [java.awt.Frame] Lew <lewbloch@gmail.com> - 2012-04-11 12:18 -0700
csiph-web