We have a Java correspondent Net “mustinherit” or “not inheritable”?

How do we declare that a class in Java must inherit rather than instantiate directly from itself, or conversely, how do we force it not to inherit? Yes Net, we can use the "mustinherit" and "notinheritable" modifiers

Solution

Abstract it

Make it final

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>