How structures inheriting from value types
If Structures does not supports inheritance, then how can we say that they are inheriting from value types?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
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
VulpesRank #55 · 29.2K reputationPosted Feb 21, 2014, 12:35 AM EST
System.ValueType overrides the virtual methods it inherits from System.Object so they are more suitable for structs.
Note that you can't explicitly inherit from System.ValueType in your own code. It follows from this that structs cannot inherit from any class other than System.ValueType.
You'll find that there's a certain amount of 'strangeness' in the way that value types (structs and enums) are dealt with in .NET because of the need to present a unified type system with reference types.