.Net (C# Programing)
what is the main difference between struct and class why and when we can use struct instead of class.
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
Praveen DhatrikaRank #3,145 · 455 reputationPosted Dec 18, 2015, 5:36 AM EST
MahaRank #2,573 · 543 reputationPosted Dec 18, 2015, 6:01 AM EST
class is a reference type.
struct is a value type.
Rajeesh MenothRank #118 · 18.4K reputationPosted Dec 18, 2015, 5:16 PM EST
And the other polymorphism technique used for structures is implementing interfaces.
Vinoth RajendranRank #74 · 25K reputationPosted Dec 18, 2015, 8:04 AM EST