Set base type for enum to long in CSharp
Description
The following code shows how to set base type for enum to long.
Example
// w w w. ja va 2s.c om
public class MainClass
{
enum PlanetPeriods :long
{
Mercury = 88,
Venus = 225,
Earth = 365,
Mars = 687
}
public static void Main()
{
System.Console.WriteLine("Orbital period for Mars = " +
(long) PlanetPeriods.Mars + " days");
}
}
The code above generates the following result.