<p>Is it possible, in Java, to enforce that a class have a specific set of subclasses and no others? For example:</p>

<pre><code>public abstract class A {}
public final class B extends A {}
public final class C extends A {}
public final class D extends A {}
</code></pre>

<p>Can I somehow enforce that no other subclasses of A can ever be created?</p>

Give class
```
A
```
a constructor with package-level accessibility (and no other constructors).
Thanks, Dave L., for the bit about no other constructors.