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#?
  1. A variable of enum cannot have a private access specifier.
  2. A variable of enum cannot have a protected access specifier.
  3. A variable of enum cannot have a public access specifier.
  4. We can define a variable of enum inside a class or a namespace.

Options:

  1. Only A
  2. Only B
  3. Only D
  4. A and B

2) There are following statements are given below, which of them are correct about enumeration in C#?
  1. int is a default underlying data type of enum.
  2. We cannot print elements of enum in the form of string.
  3. Every enum created in C#.Net is derived from Object class.
  4. We need to use an implicit cast to convert enum type to an integral type.

Options:

  1. Only B
  2. Only D
  3. B and D
  4. A and C

3) Can we declare an enum inside the class?
  1. Yes
  2. No

4) Is it true, the value of each successive enum is decreased by 1?
  1. Yes
  2. No

5) Is it true, the value of each successive enum is increased by 1?
  1. Yes
  2. No





Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.