Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

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

user-image
Question ajoutée par Ubaid sayeed Mohd abdul sayeed , Senior Programmer , Moksha solutions
Date de publication: 2016/09/22
Igor Polischuk
par 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
par 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
par 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