What’s the syntax to import a class in a default package in Java? [duplicate]

You can’t import classes from the default package. You should avoid using the default package except for very small example programs.

From the Java language specification:

It is a compile
time error to import a type from the
unnamed package.

Leave a Comment