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.
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
Hemant KumarRank #1,202 · 1.5K reputationPosted Sep 29, 2011, 11:06 PM EDT
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.
Pravin MoreRank #1,419 · 1.2K reputationPosted Sep 29, 2011, 11:08 PM EDT
Thanx,
Pravin.
VulpesRank #55 · 29.2K reputationPosted Sep 30, 2011, 12:48 AM EDT