C#中枚举类型用Enum表示
class Example2_10
{
enum Planets
{
Mercury = 1,
Venus,
Earth,
Mars,
Jupiter,
Saturn,
Uranus,
Neptune,
Pluto
}
public static void Main()
{
System.Console.WriteLine("Position of Earth = " +
(int)Planets.Earth);
System.Console.WriteLine("Planets.Earth = " +
Planets.Earth);
string i = System.Console.ReadLine();
}
}