C# Online Quiz


Advertisements


Following quiz provides Multiple Choice Questions (MCQs) related to C#. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - Which of the following keyword is used for including the namespaces in the program in C#?

A - imports

B - using

C - exports

D - None of the above.

Answer : B

Explanation

The using keyword is used for including the namespaces in the program.

Answer : D

Explanation

All of the above options are correct.

Q 3 - Which of the following converts a type to a double type in C#?

A - ToDecimal

B - ToDouble

C - ToInt16

D - ToInt32

Answer : B

Explanation

ToDouble() method converts a type to a double type.

Q 4 - Which of the following operator creates a pointer to a variable in C#?

A - sizeof

B - typeof

C - &

D - *

Answer : D

Explanation

* operator creates a pointer to a variable.

Q 5 - Which of the following access specifier in C# allows a class to hide its member variables and member functions from other functions and objects?

A - Public

B - Private

C - Protected

D - Internal

Answer : B

Explanation

Private access specifier allows a class to hide its member variables and member functions from other functions and objects.

Q 6 - Which of the following property of Array class in C# checks whether the Array is readonly?

A - IsFixedSize

B - IsReadOnly

C - Length

D - None of the above.

Answer : B

Explanation

IsReadOnly gets a value indicating whether the Array is readonly.

Q 8 - C# supports multiple inheritance.

A - true

B - false

Answer : B

Explanation

C# does not support multiple inheritance.

Q 9 - Which of the following preprocessor directive allows creating a compound conditional directive in C#?

A - elif

B - define

C - if

D - else

Answer : A

Explanation

#elif − It allows creating a compound conditional directive.

Q 10 - User-defined exception classes are derived from the ApplicationException class in C#?

A - true

B - false

Answer : A

Explanation

User-defined exception classes are derived from the ApplicationException class.


csharp_questions_answers.htm

Advertisements