Import package.* vs import package.SpecificType [duplicate]

Take a look at the java API, and you’ll see many classes and interfaces with the same name in different packages.

For example:

java.lang.reflect.Array
java.sql.Array

So, if you import java.lang.reflect.* and java.sql.* you’ll have a collision on the Array type, and have to fully qualify them in your code.

Importing specific classes instead will save you this hassle.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)