Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Uday DodiyaRank #239 · 10.3K reputationPosted Sep 30, 2022, 12:34 AM EDT
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:sealed class MySealedClass : BaseClass // is ok class MyOtherClass : MySealedClass // won't compileA
staticclass cannot inherit from other classes.Vishal JoshiRank #377 · 6.7K reputationPosted Sep 30, 2022, 2:08 AM EDT
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
Vishal YelveRank #178 · 13.6K reputationPosted Sep 30, 2022, 2:57 AM EDT
Hi Naresh,