Hi,

Another reason: It makes it easy for the code reader
to quickly find out the package a particular class is
in: You just search for the class name from the start
of the source file.


Best Regards,

Ole Husgaard.


Scott M Stark wrote:
> 
> So you can know what is being used and in general wild card imports
> cannot be used as this causes conflicts when two packages have a
> class with the same name(Attributes for example):
> 
> import javax.naming.directory.*;
> import org.xml.sax.*;
> 
> class tstImport
> {
>     public static void main(String[] args)
>     {
>         Attributes attrs = null;
>     }
> }
> bash-2.04$ javac tstImport.java
> tstImport.java:8: reference to Attributes is ambiguous, both class 
>org.xml.sax.Attributes in org.xml.sax and class
> javax.naming.directory.Attributes in javax.naming.directory match
>                 Attributes attrs = null;
>                 ^
> 1 error
> 
> ----- Original Message -----
> From: "Matt Veitas" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, June 24, 2001 6:56 AM
> Subject: [JBoss-dev] Reasons for using Explicit Imports?
> 
> Could you briefly explain the reasoning behind EXPLICIT IMPORTS? What is
> wrong with using wildcards. My guess is that by looking at the explicit
> import list you can have some sense of what exactly is being used or is
> there a performance issue?
> 
> Matt
> 
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-development

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to