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

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

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

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:
Does importing a package imports the subpackages as well? e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests?
Importing Your Own Package
Advertisements
import package.subpackage.* does not work
package javax.ws.rs does not exist
package org.hibernate.util does not exist
package javax.servlet does not exist
Importing in java . . . .
package javax.validation does not exist
package org.springframework.scheduling.quartz does not exist
Importing hibernate project
Package does not exist.. - Java Beginners
In netbean jdk, it does not import the file,"java.nio.file.Paths". why?.
Importing a vdi file in VirtualBox
ModuleNotFoundError: No module named 'Importing'
Importing in eclipse - Java Beginners
importing data and edit that data
importing pyspark in python shell
importing pyspark in python shell
importing excel file
importing client side web history
ModuleNotFoundError: No module named 'custom-test-package-that-does-nothing'
ModuleNotFoundError: No module named 'custom-test-package-that-does-nothing'
Importing data into sql plus from a text file...
Importing data into sql plus from a text file...
where are the all library files of netbeans 7.0 ? Because it does not import the file,"java.nio.file.Paths"
Does hibernate support polymorphism?
Jquery form validation does not work
Jquery form validation does not work
Does memory for Class or Object?
Does Google use R?
Does true AI exist?
Does ml require coding?
Does Coding increase IQ?
Does SPSS use Python?
Does AI require coding?
Does Google use AI?
Does Python require math?
importing excel file and drawing multiple graphs from one excel file
What does COMMIT do?
importing CSV data into Database in java when the no of columns are known using javacsv
Importing Preferences
What does the delete operator do?
What does the delete operator do?
Does finally always execute in Java?
what does business analyst mean
Does finally always execute in Java?
Does finally always execute in Java?
Does finally always execute in Java?
How to import existing maven project in Eclipse?
How to import existing maven project in Eclipse?

Ads