top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Java: Does importing a package imports the subpackages as well?

–2 votes

e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests.*?

posted Mar 26, 2014 by Prachi Agarwal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
Not in Java., and not in python....Don't know about other languages :). In C and C++ there is some other mechanism

1 Answer

0 votes

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.


answer Mar 26, 2014 by Luv Kumar
Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.