Set initial Enum Values in CSharp
Description
The following code shows how to set initial Enum Values.
Example
/*w w w .ja v a2s . com*/
public class EnumValues
{
// declare the enumeration
enum Temperatures
{
WickedCold = 0,
FreezingPoint = 32,
LightJacketWeather = 60,
SwimmingWeather = 72,
BoilingPoint = 212,
}
static void Main( )
{
System.Console.WriteLine("Freezing point of water: {0}",
(int) Temperatures.FreezingPoint );
System.Console.WriteLine("Boiling point of water: {0}",
(int) Temperatures.BoilingPoint );
}
}
The code above generates the following result.