Re: Understanding class access



On May 31, 1:56 pm, André Wagner <andre....@xxxxxxxxx> wrote:
If you don't want MySubClass to be subclassed, declare it final --
that's what it's there for.

What I mean is: I don't want it to be accessed.

If you don't want it confusing people or "cluttering things up", just
don't include the javadoc for mysubpackage in your released
documentation bundle, or include in the package-info.html that it's a
private subpackage of little interest to most users.

If you really want to completely deny access to MySubclass except via
MyClass, make it a private nested class of MyClass.

.