Home »
Aptitude Questions and Answers »
C# Aptitude Questions and Answers
C# Enumeration Aptitude Questions and Answers | Set 2
C# Enumeration Aptitude Questions | Set 2: 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#?
- A variable of enum cannot have a private access specifier.
- A variable of enum cannot have a protected access specifier.
- A variable of enum cannot have a public access specifier.
- We can define a variable of enum inside a class or a namespace.
Options:
- Only A
- Only B
- Only D
- A and B
Correct answer: 3
Only D
Only D statement is correct about enum.
2) There are following statements are given below, which of them are correct about enumeration in C#?
- int is a default underlying data type of enum.
- We cannot print elements of enum in the form of string.
- Every enum created in C#.Net is derived from Object class.
- We need to use an implicit cast to convert enum type to an integral type.
Options:
- Only B
- Only D
- B and D
- A and C
Correct answer: 4
A and C
The A and C statements are correct about enum.
3) Can we declare an enum inside the class?
- Yes
- No
Correct answer: 1
Yes
Yes, we can declare an enum inside the class.
4) Is it true, the value of each successive enum is decreased by 1?
- Yes
- No
Correct answer: 2
No
No, it is not true.
5) Is it true, the value of each successive enum is increased by 1?
- Yes
- No
Correct answer: 1
Yes
Yes, it is true.