C# 2008 aka C# 3.0Discuss the Visual C# 2008 (aka C# 3.0) language
Welcome to the p2p.wrox.com Forums.
You are currently viewing the C# 2008 aka C# 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
I don't suppose the answer 'because its static' is enough for you huh?
You might as well ask, why can't I walk through this wall here - why do I have to use the door over there instead - well, because whoever designed the house put the wall there and the door over there for a reason.
__________________
/- Sam Judson : Wrox Technical Editor -/
Static means a class that have only static members and we can not create any object with that class. But the point is why Microsoft is not allowing us to extends the static class with another static class?
By inheriting a class we can create one or more specific functionality. For example 'Animal' to 'Dog'. But if the Animal and Dog class are static, then what will be the problem? Why we can not extends the static functionality?
One thing is that we can not create any object for static class. So by inheriting them we can not do any dynamic polymorphism with that. Brcause dynamic polymorphism is totally based on runtime object type. It will be a good reason to not allowinging static class in inheritence.
I'm still not 100% sure where you are coming from on this but I think you are over thinking it. You would never create a static class around a concept like 'Animal' or 'Dog' in the first place, as these are not static concepts.
__________________
/- Sam Judson : Wrox Technical Editor -/
The static means that it is non-changeable or non-moveable. So what you are going to do with the non-changeable members of a static class? Animals will have a lot of properties and the Dog will inherit a few properties of animal then why you are not using an interface to extend the properties of Animal. In any language, the static class is non-extendable...