Home »
Aptitude Questions and Answers »
C# Aptitude Questions and Answers
C# Enumeration Aptitude Questions and Answers | Set 1
C# Enumeration Aptitude Questions | Set 1: This section contains aptitude questions and answers on C# Enumeration.
Submitted by Nidhi, on April 02, 2020
1) There are following statements are given below, which of them are correct about enumeration in C#?
- Enumeration is used to assign the names to integral constants, which makes the program readable.
- It is a reference data type.
- Enumeration is not supported in C#
- It is used only in VB.NET
Options:
- Only A
- Only B
- C and D
- B and C
Correct answer: 1
Only A
The only A statement is correct about the enumeration in C#.NET.
2) There are following data types are given below, which of them cannot be used as an underlying data-type in the enumeration?
- int
- short
- byte
- float
- double
Options:
- Only C
- A and B
- D and E
- A, B and C
Correct answer: 3
D and E
In C#.NET, we cannot use float or double data types as an underlying data type in the enumeration.
3) In C#.NET, which keyword is used to create an enumeration?
- enumerate
- enumeration
- Enum
- enum
Correct answer: 4
enum
In C#.NET, enum keyword is used to create an enumeration.
4) Can we inherit enum values in C#.NET?
- Yes
- No
Correct answer: 2
No
No, we cannot inherit enum values in C#.NET.
5) In C#.NET, enum is?
- Reference type
- Value type
- Both types
- Code type
Correct answer: 2
Value type
In C#.NET, enum is a value type.