Is it possible to import all subpackages at once in Java?
As I learned it seems possible in C#:
C# how to import namespaces at once
No.
import javax.swing.*;
will import only the classes in the javax.swing
package. It will not import subpackages such as javax.swing.event
. You would need a separate import for each subpackage:
import javax.swing.event.*;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With