zoukankan      html  css  js  c++  java
  • 枚举类型

    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();
        }

    }

  • 相关阅读:
    SRM482
    SRM481
    SRM480
    SRM479
    SRM478
    vue-cli 3 is not a modual err
    .vimrc
    css3 导入字体
    class []的用法
    RK61 Keyboard Use
  • 原文地址:https://www.cnblogs.com/djcsch2001/p/2035675.html
Copyright © 2011-2022 走看看