I use package-private classes and methods when I want to hide implementation details from users (and other classes) outside the package.
For example, if I have an interface and a factory class that creates instances of this interface, I may have an implementation class as a separate file, but mark it with private-package so that others cannot use it and it will not interfere with JavaDoc (if javadoc is configured to publish only).
If you seal your jar file, private-private methods can also help limit access to these methods. If the method is public or protected, subclasses can still see and call this method, even if it is in another package. (Unsealed banks allow someone to create classes in your packages so that they gain access to private or secure methods)
source share