Which keyword is used in C# to avoid inheritance? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 4

Which keyword is used in C# to avoid inheritance?

27th Apr 2019, 10:23 AM
Dhruvin Patel
Dhruvin Patel - avatar
3 Respostas
+ 7
In order to prevent a class inĀ C#Ā from beingĀ inherited, theĀ keywordĀ sealed isused.
27th Apr 2019, 10:31 AM
Alessio Benvenuti
Alessio Benvenuti - avatar
+ 2
Similar to 'final' in Java when applied to classes. Cmiiw.
28th Apr 2019, 1:20 AM
Sonic
Sonic - avatar
+ 1
'Sealed' class is used to avoid inheritance.
28th Apr 2019, 5:52 AM
Gayan Charith Elgiriya
Gayan Charith Elgiriya - avatar