We can’t Inherit
Interviews15 answers
Can we inherit Static Class in C# ?
15 Answers
Sanjay KumarPosted Apr 23, 2022, 1:54 AM EDT
Any class which does not contain instance contructor, cannot be inherited. Static class by default do not have non-static contructor (instance contructor) and that is why you cannot inherit it.
Sonil KumarPosted Jul 27, 2021, 7:47 AM EDT
Not possible to inherit static class in c#. Basic usage of the static class is to make method and member static and can invoke by using name of the class without creating the object of the static class. The main purpose of the static class is to create only one istance of the member in the memory.
Saurabh VasaniPosted Jul 25, 2019, 9:15 PM EDT
No, When working with static class oop says static class is sealed and can not be inherited by another class.
Radhesham KhatriPosted Jul 15, 2019, 12:12 AM EDT
No, compilation error occurs .
siva bPosted Mar 13, 2019, 1:20 AM EDT
No
Amit PrakashPosted Jan 1, 2019, 8:52 PM EST
static classes can't be inherited.
we can not define static class as derived class from any class except Object class.
Bhanuprasad MitturiPosted Nov 20, 2018, 1:06 AM EST
No, we can't.
Sreekanth ReddyPosted Oct 23, 2018, 12:45 AM EDT
The compiler will guarantee that instances of this class cannot be created. Static classes are sealed and therefore cannot be inherited. They cannot inherit from any class except Object. ... For more information, see Static Constructors (C# Programming Guide)
https://stackoverflow.com/questions/774181/why-cant-i-inherit-static-classes
Bhavesh GhulPosted Oct 19, 2018, 2:49 AM EDT
No you cannot inherit
Madan ShekarPosted Oct 17, 2018, 10:32 PM EDT
No, It's not possible to inherit Static class.
Vikas AgarwalPosted Oct 5, 2018, 4:51 AM EDT
Static classes are sealed classes so we can't inherit that.
Chandan PrasadPosted Oct 4, 2018, 7:35 PM EDT
static classes are sealed classes , they can not be inherit
Ina GuptaPosted Oct 3, 2018, 7:45 PM EDT
yes
Rasool balteePosted Oct 3, 2018, 11:38 AM EDT
NO, we can not inherit static class in c# because they are sealed and abstract. There seems to be no good reason to inherit a static class. It has public static members that you can always access via the class name itself.
Hitanshi MehtaPosted Sep 28, 2018, 8:26 AM EDT









