Home > DeveloperSection > Interviews > Does importing a package imports the subpackages as well? e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests.*?

Posted on    July-24-2015 11:01 PM

 Java Java 
 1 Answer(s)
  525  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Posted on    July-24-2015 11:01 PM

No you will have to import the subpackages explicitly. Importing com.MyTest.* will import classes in the package MyTest only. It will not import any class in any of it's subpackage.

Don't want to miss updates? Please click the below button!

Follow MindStick