Maximum number of classes a sealed class can inherit ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Maximum number of classes a sealed class can inherit ?

The answer is 1. But the sealed class restrict inheritance so how it can inherit a class ? anyone could please explain these doubt ?

6th Jul 2017, 4:27 PM
Amit Ghatge
Amit Ghatge - avatar
1 Answer
0
from a sealed class no other class can be derived (inherit). but the sealed class itself can inherit from a base class. with other words: in the tree of classes with object asthe root, sealed classes are always leafs.
6th Jul 2017, 8:21 PM
Volker Milbrandt
Volker Milbrandt - avatar