No nested packages do not exist in Java.
However, their is the case where there will be a class in the package such that the package path would look like this:
com.foo.Bar
And then there could exist further package directories under it such that another class's package path could look like this:
com.foo.boo.Lou
Oracle's Documentation here's a link provides a good overview of access control for classes.
This one here explains when to use nested classes and I think would give you a better explanation which I'll quote below:
Use it if your requirements are similar to those of a local class, you
want to make the type more widely available, and you don't require
access to local variables or method parameters.
- Use a non-static nested class (or inner class) if you require access to an enclosing instance's non-public fields and methods.
Use a static nested class if you don't require this access.
And Here's a supplemental link to some more information on the differences between class types and package privacy.
Hope this helps.