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