Which class can't be inherited further ? :-Sealed & Static
Loading
Which class can't be inherited further ? :-Sealed & Static
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vishal YelvePosted Sep 30, 2022, 6:57 AM
Hi Naresh,
Vishal JoshiPosted Sep 30, 2022, 6:08 AM
Sealed Class
Static Class
Also, find below link for a static class
https://www.c-sharpcorner.com/interview-question/can-we-inherit-static-class-in-c-sharp
Uday DodiyaPosted Sep 30, 2022, 4:34 AM
Static Class
A class can be declared static, indicating that it contains only static members. It is not possible to create instances of a static class using the new keyword. Static classes are loaded automatically by the .NET Framework common language runtime (CLR) when the program or namespace containing the class is loaded.
Sealed Class
A sealed class cannot be used as a base class. Sealed classes are primarily used to prevent derivation. Because they can never be used as a base class, some run-time optimizations can make calling sealed class members slightly faster.
You can let a
sealedclass inherit from another class, but you cannot inherit from asealedclass:A
staticclass cannot inherit from other classes.