PHP low-level programming of the brothers to see this problem, I made the following statement, I hope to be able to objectively understand the advantages and disadvantages of this enum field:Fat Brother View:Enum has advantages. But personally feel .
Enum typeAn enumeration type (enumeration) is a derived data type in C + +, which is a collection of user-defined enumeration constants.If a variable has only a few possible values, it can be defined as an enumeration (enumeration) type. The
Enum typeAn enumeration type (enumeration) is a derived data type in C + +, which is a collection of user-defined enumeration constants.If a variable has only a few possible values, it can be defined as an enumeration (enumeration) type. The
Original article: c # enum usage enumeration usage Asp.net ENUM usage
The enum keyword is used to declare enumeration, which is a unique type consisting of a group of named constants called the enumeration list. Each Enumeration type has a base type,
Public Abstract classEnumextendsEnum>ImplementsComparable, Serializable {Private FinalString name; //Current enumeration constant name Public FinalString name () {returnname; } Private Final intordinal; //Current enumeration constant
Enum (C # reference)
-->
The enum keyword is used to declare enumeration, which is a unique type consisting of a group of named constants called the enumeration list.
Generally, it is better to define an enumeration in the namespace so
All I have described above are value types, so much so that I summarize the following what is called value type. Simply put, this type of variable stores the contained values directly. Here we are relative to the C language string, char ch[6] = "HC66
Java enum Enumeration
Java is not enumerated before. To use a feature similar to enumeration, that is, to use constants, you can use the following code:
Definition of constants in Java:
PublicclassSex2 {
PublicstaticfinalintGIRL=
Assuming that you need several possible values for a variable, you can be defined as an enumeration type. The enumeration means that it is possible to say that a variable or an object that is called a possible value is one by one cases.Give a sample
In general, we use the C-style enum keyword to define enumeration types.[CPP]View Plaincopy
enum{
Uiviewanimationtransitionnone,
Uiviewanimationtransitionflipfromleft,
Uiviewanimationtransitionflipfromright,
Suppose you need several possible values for a variable, then it can be defined as an enumeration type. The reason for enumeration is to enumerate the possible values of variables or objects.For example, to make everyone more clear, for example,
Let's look at an extremely simple Enum.
/// // Chinese English // enum Chinglish {Niubility, Zhuangbility, Shability, Erbility ,}
(In an episode: the above four enum values for Chinese English come from --
Registrant people think they are
Assuming that you need several possible values for a variable, you can be defined as an enumeration type. The enumeration means that it is possible to say that a variable or an object that is called a possible value is one by one cases.Give a sample
Java Development often uses a limited number of constants, which can be defined within the bean as an enum type, so in the maintenance of more convenient to control, so here is a simple record of the definition and usage of enum, convenient for
String data type Set,enum in MySQL1. EnumA single-choice string data type that is suitable for storing "radio values" in the form interface.When you set an enum, you need to give a "fixed number of options" and store only one of the values.To set
EnumThe keyword is used to declare enumeration, which is a unique type consisting of a group of named constants called the enumerated number list. Each Enumeration type has a base type, which can be any integer except char. That is:
(Byte, sbyte,
Li Wu:Learn to think more, honouring teachers save Thanksgiving. Leaf See root Three return one, living water Qingyuan hidden in zero.Meekness The Lord of Conscience, Haoyuedangkong the King of Freedom. Willing to give the most ascetic no regrets,
In front of the DCL can be used to solve the multi-threaded singleton mode of non-threading security, although the look is very perfect, but there are some problems, the specific analysis look at this article:
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.