Is the use of Java's default package a bad practice?

java, package

Solution

Yes, it is. Ideally, package names should be globally unique, to avoid naming collisions. Using the default package breaks this convention. It's also impossible to import a class from the default package.

Why do unnamed packages exist at all, if it's such a bad idea? From the JLS §7.4.2:

Unnamed packages are provided by the Java platform principally for convenience when developing small or temporary applications or when just beginning development.

Problem

Is the use of Java's default package a bad practice?

Original source

Related problems