Hi...
I want to know, what is default value of enum in .net ? Please tell me anyone ?
Thanks....
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
VulpesRank #55 · 29.2K reputationPosted Jan 11, 2012, 1:59 AM EST
Satyapriya NayakRank #47 · 31.5K reputationPosted Jan 11, 2012, 1:46 AM EST
Integers in the C# programming language are always initialized to zero when they are fields of a class. When you have an enum field, it will also be initialized to zero. To make enums valid, always use the default value of zero
Please refer the below link
http://www.dotnetperls.com/enum
Thanks
Ankit Shivnakr87 reputationPosted Jan 11, 2012, 1:57 AM EST
default, the first enumerator has the value 0, and the value of each successive enumerator is increased by 1.
Pravin MoreRank #1,419 · 1.2K reputationPosted Jan 11, 2012, 2:03 AM EST
default value for any enum is zero(0)
Vineet Kumar SainiRank #257 · 9.8K reputationPosted Jan 11, 2012, 6:07 PM EST
vyar throt2 reputationPosted Jul 13, 2014, 9:42 PM EDT
enum Tempurature
{
Low = 2,
Medium,
High,
};
The value of Medium is 3
Source: http://csharp.net-informations.com/statements/enum.htm
Vyar