Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Interview-Questions Does importing a package imports the subpackages as well? e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests?

Have Programming Question? Ask it here!
 
 
 


samar
Does importing a package imports the subpackages as well? e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests?
1 Answer(s)      3 years and 9 months ago
Posted in : Java Interview Questions


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


Advertisement
View Answers

November 13, 2010 at 1:17 PM


Hi,

Here is the answer,

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.



Related Tutorials/Questions & Answers:
Advertisements
 

 

 

DMCA.com