Do we have a Java correspondent to .NET "mustinherit" or "notinheritable"?

java, oop

Solution

must be inherited and not directly instantiated from itself

Make it `abstract`.

or the opposite, how to force it not being inherited?

Make it `final`.

Problem

How can We state that a certain class in Java must be inherited and not directly instantiated from itself, or the opposite, how to force it not being inherited? In .NET we are able to use the "mustinherit" and "notinheritable" modifiers.

Original source