May 14 Enumeration type

Source: Internet
Author: User

namespace_ May 14 _ enum type {classProgram {enumMeiju//the default is int when no value type is specified{ One=3,//is not an assignment, it is a pointer to an index, index 3rd is the index position of onetwo=6,//index number 6th is the constant of theThree,//each line is separated by commas, and the last comma can be omittedfour =//if a constant equals a previous constant, then it is equal to this constant, and here is the assignment                    }        enumMEIJU1 { One=1, the other=2, three, four=Three,}Static voidMain (string[] args) {            //struct: Define the next set of variables//Enum Type: Defines the next set of constants, can only be referenced, cannot be assigned a const int q=5;Console.WriteLine (meiju.one);//print out "one"Console.WriteLine (Meiju.four);//The print is "both" .Console.WriteLine (meiju1.four);//It's printed "three."Console.ReadLine (); }    }}

May 14 Enumeration type

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.