Re: Can two classes with the same co-exist?



laredotornado wrote:
Hi,

I'm using Java 1.5 . I currently have two imports that use the same
class name:

import javax.faces.application.Application;
import com.myco.nps.im.dto.applications.Application;

Unsurprisingly, when I compile, I get the compilation error

[javac] /export/third-party/etsbea/staging/wls_9.2.2/
nps_config_gui/src/com/myco/npsconfig/jsf/controllers/
AddApplicationPage.java:27: javax.faces.application.Application is
already defined in a single-type import
[javac] import com.myco.nps.im.dto.applications.Application;

I didn't write either class but I need them both. Any way I can get
around this compilation error?

Fully qualified names:

javax.faces.application.Application app = /*...*/;

I would import the one you use the most.


--
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth
.



Relevant Pages

  • Re: ELF loading
    ... the source in a way that it produces a compilation error, ... PE exe generated by RosAsm contains also the source code ... so that the embedded source differs from the binary. ...
    (alt.lang.asm)
  • Re: [PATCH] debug: fix BUILD_BUG_ON() for non-constant expressions
    ... Ingo Molnar wrote: ... Subject: [PATCH] debug, ... * Force a compilation error if condition is true [array index becomes ...
    (Linux-Kernel)
  • Compilation error with GNAT
    ... I have a large set of source files, some of which are spec ... it reports a compilation error. ... to check package spec for errors, ...
    (comp.lang.ada)
  • A compilation error.
    ... The folliowing code gives me a compilation error, ... MSVC 6.0 and intel 8.0 compiler. ... g++ 3.3.1 and borland 5.5 ...
    (comp.lang.cpp)
  • Re: Can two classes with the same co-exist?
    ... I'm using Java 1.5. ... I currently have two imports that use the same ... Unsurprisingly, when I compile, I get the compilation error ...
    (comp.lang.java.programmer)