Re: Can two classes with the same co-exist?
- From: Owen Jacobson <angrybaldguy@xxxxxxxxx>
- Date: Fri, 29 Aug 2008 10:57:25 -0700 (PDT)
On Aug 29, 1:45 pm, laredotornado <laredotorn...@xxxxxxxxxxx> 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?
By referring to one or both classes by fully-qualified name
(javax.faces.application.Application,
com.myco.nps.im.dto.applications.Application) in the class, rather
than importing both. import statements do nothing more than tell the
compiler which fully-qualified name to expand a short name to; they
have no impact on which classes are available.
-o
.
- References:
- Can two classes with the same co-exist?
- From: laredotornado
- Can two classes with the same co-exist?
- Prev by Date: Re: Can two classes with the same co-exist?
- Next by Date: Re: Can two classes with the same co-exist?
- Previous by thread: Re: Can two classes with the same co-exist?
- Next by thread: Re: Can two classes with the same co-exist?
- Index(es):
Relevant Pages
|