answersLogoWhite

0

A default package is a package with no name. You can create a Java class without putting package name on top of the code. This class is included in the "default package".

Be careful not to be confused with java.lang, which is a package that contains Java's fundamental classes and get's imported by default.

User Avatar

Wiki User

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
JudyJudy
Simplicity is my specialty.
Chat with Judy
More answers

The default package is an unnamed package. The unnamed package contains java classes whose source files did not contain a package declaration. The purpose of default package is for convenience when developing small or temporary applications or when just beginning development.The compiled class files will be in the current working directory.

User Avatar

Wiki User

6y ago
User Avatar

Add your answer:

Earn +20 pts
Q: What is a default package in Java?
Write your answer...
Submit
Still have questions?
magnify glass
imp