Enumerations - General Questions Online Exam Quiz

Enumerations - General Questions GK Quiz. Question and Answers related to Enumerations - General Questions. MCQ (Multiple Choice Questions with answers about Enumerations - General Questions

Which of the following statements are correct about an enum used inC#.NET?

Options

A : 1, 2

B : 3, 4

C : 4, 5

D : 1, 4

View Answer

Which of the following statements is correct about the C#.NET code snippet given below?

Options

A : Variables cannot be assigned to enum elements.

B : Variables can be assigned to any one of the enum elements.

C : Variables can be assigned only to the first enum element.

D : Values assigned to enum elements must always be successive values.

View Answer

Which of the following statements is true about an enum used in C#.NET?

Options

A : An implicit cast is needed to convert from enum type to an integral type.

B : An enum variable cannot have a public access modifier.

C : An enum variable cannot have a private access modifier.

D : An enum variable can be defined inside a class or a namespace.

View Answer

Which of the following is the correct output for the C#.NET code snippet given below?

Options

A : 1

B : -1

C : red

D : 0

View Answer

Which of the following statements are correct about an enum used inC#.NET?

Options

A : 1, 3

B : 2, 4

C : 2, 5

D : 3, 4

View Answer

Which of the following will be the correct output for the C#.NET code snippet given below?

Options

A : -3, -2, -1

B : -3, 0, 1

C : 0, 1, 2

D : red, green, blue

View Answer

An enum that is declared inside a class, struct, namespace or interface is treated as public.

Options

A : True

B : False

C : -

D : -

View Answer

Which of the following statements is correct about the C#.NET code snippet given below?

Options

A : The program will output a value 11 .

B : The program will output a value 1 .

C : The program will output a value 2 .

D : The program will report an error since an enum element cannot be assigned a value outside the enum declaration.

View Answer

Which of the following is the correct output for the C#.NET code snippet given below?

Options

A : 2, 11

B : 1, 11

C : 2, 6

D : 1, 5

View Answer

An enum can be declared inside a class, struct, namespace or interface.

Options

A : True

B : False

C : -

D : -

View Answer

Attributes - General Questions more Online Exam Quiz

Collection Classes - General Questions

Constructors - General Questions

Datatypes - General Questions

Delegates - General Questions

.NET Framework - General Questions

Exception Handling - General Questions

Functions and Subroutines - General Questions

Inheritance - General Questions

Interfaces - General Questions