C#
class myClass { int age; public int Age { get{return age;} set{age = value;} }Versus
C#
class myClass { public int Age{get; set;} }What's the difference between these two? Are they both the same?
class myClass { int age; public int Age { get{return age;} set{age = value;} }Versus
class myClass { public int Age{get; set;} }What's the difference between these two? Are they both the same?
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
Manas MohapatraRank #182 · 13.2K reputationPosted May 5, 2017, 3:51 AM EDT
MayankRank #4,018 · 371 reputationPosted May 5, 2017, 3:26 AM EDT
2. class myClass { public int Age{get; set;} }Amit GuptaRank #190 · 12.8K reputationPosted May 5, 2017, 3:44 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted May 5, 2017, 3:13 AM EDT