Hi Everyone,
Why can't we make inherit the static classes?
Thanks,
maheswar
Loading
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.
VulpesPosted Sep 30, 2011, 4:48 AM
Pravin MorePosted Sep 30, 2011, 3:08 AM
Thanx,
Pravin.
Hemant KumarPosted Sep 30, 2011, 3:06 AM
Citation from here:
This is actually by design. 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. The only reasons I have seen for inheriting static stuff have been bad ones, such as saving a couple of characters of typing.
There may be reason to consider mechanisms to bring static members directly into scope (and we will in fact consider this after the Orcas product cycle), but static class inheritance is not the way to go: It is the wrong mechanism to use, and works only for static members that happen to reside in a static class.