Re: Can two classes with the same co-exist?
- From: Andreas Leitgeb <avl@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 29 Aug 2008 17:59:30 GMT
laredotornado <laredotornado@xxxxxxxxxxx> wrote:
import javax.faces.application.Application;
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?
It's important to know, what the "import" really does:
It allows you to furtheron access the class by its
short name, (as well as still with it's complete name).
Nothing else!
So, you could just as well drop both "import"s, and whereever
you use the first one, you just spell it out completely:
javax.faces.application.Application
and where you need the other one, you spell out that one
completely:
com.myco.nps.im.dto.applications.Application
Unless the context of each use makes it very clear, which one
is really used, you *really should* always spell them both out
by their full names and not "import" either of them!
Otherwise, if they just have a same short name, but are
used completely differently, then you can choose the more
frequently used one, and import that, so you can write
that more concise.
.
- 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: Best practices for declared exceptions
- Previous by thread: Re: Can two classes with the same co-exist?
- Index(es):