How many entries can an enum in .NET have?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m pretty certain the underlying type is an integer type (not necessarily an
int). This page here states that:and:
So I would suggest the only limitation will be the range of
long/ulong(well into the billions) and the allowable symbol space in the compiler for enumerations (you’ll most likely strike that limitation first if you’re actually creating truly massive enumerations).If you specify a smaller type for your enumeration (e.g.,
short), the range will be reduced accordingly.