Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import all subpackages at once in Java [duplicate]

Tags:

java

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

like image 932
user310291 Avatar asked Dec 22 '22 18:12

user310291


1 Answers

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.*;
like image 196
robert_x44 Avatar answered Dec 24 '22 08:12

robert_x44