Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

Why the base class and derive class has to be STATIC while using Static keyword?

user-image
Question added by Ubaid sayeed Mohd abdul sayeed , Senior Programmer , Moksha solutions
Date Posted: 2016/09/22
Igor Polischuk
by Igor Polischuk , Software Engineer , EPAM

This question was very interesting for me and I've started investigation. I have never thought to use this approach. I mean to derive one static class from another. So, I found out that .NET Framework doesn't allow to derive one static class from another. The static class must be derived directly from System.Object.

Nimish Pankhania
by Nimish Pankhania , Full Stack Developer .NET , Capita ITS

The keyword STATIC defines a singleton class therefore to derive from a static class the base class has to be the same type.

Bineesh VP
by Bineesh VP , Software Developer , Unknown

There would be base class function like Public static virtual DoSomething()

This function is overrided in derived class like Public static Override DoSomething()

 

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.