1) Enums stands for ?
Ans) Enums stands for Enumerations
2) What is underlying type for enum?
Ans) The default underlying type of an enum is int.
The default value for first element is ZERO and gets incremented by 1.
3) Is it posible to customize the underlying type and values?
Ans) Yes, It is possible to customize the underlying type and values.
4) Is Enums are value types?
Ans) Yes, Enums are value types.
5) Enum keyword (all small letters) is used to create enumerations, where as Enum class, contains static GetValues() and GetNames() methods which can be used to list Enum underlying type Values and Names.
6) What is the use of Enum?
Ans) If a program used set of integral numbers, better replacing them with enums, which makes the program more
Readable
Maintainable
Example :
8) Can you write a code to customize enum type?
Ans)
9) Can you write a code to customize Enum values?
Ans)
Ans) Enums stands for Enumerations
2) What is underlying type for enum?
Ans) The default underlying type of an enum is int.
The default value for first element is ZERO and gets incremented by 1.
3) Is it posible to customize the underlying type and values?
Ans) Yes, It is possible to customize the underlying type and values.
4) Is Enums are value types?
Ans) Yes, Enums are value types.
5) Enum keyword (all small letters) is used to create enumerations, where as Enum class, contains static GetValues() and GetNames() methods which can be used to list Enum underlying type Values and Names.
6) What is the use of Enum?
Ans) If a program used set of integral numbers, better replacing them with enums, which makes the program more
Readable
Maintainable
Example :
The above code is more readable.
7) Write a code to get Enum values and names?
Ans)
8) Can you write a code to customize enum type?
Ans)
9) Can you write a code to customize Enum values?
Ans)
No comments:
Post a Comment