Enumerations

Unknown | 2:34 AM |


Enumerations are types that inherit from System.Enum. The elements of an enumeration
are expressed in words rather than numbers, which makes it convenient for understanding
the meaning of the value being used. Enumerations symbolically represent a set of values
of one of the primitive integral types.
The type of the elements of an enumeration can be byte, short, int or long. If no type is
specified explicitly, the default type is int.

Example:
enum month : byte
{Jan = 2, Feb = 5, Mar = 10};


Explanation:
In the above code segment, an enumeration type month is declared. The underlying type
of the elements has been specified as byte. It has three elements viz: Jan, Feb and Mar.
These three elements have been assigned specific values. In case of an enumeration, if no
values are specified, the value of the first element corresponds to 0 and so on.

Category:

About http://dotnetvisual.blogspot.in/:
DOT NET TO ASP.NET is a web application framework marketed by Microsoft that programmers can use to build dynamic web sites, web applications and web services. It is part of Microsoft's .NET platform and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime, allowing programmers to write ASP.NET code using any Microsoft .NET language. create an application very easily ....