C# Online Quiz


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

Answer : D

Explanation

All of the above options are correct.

Answer : D

Explanation

All of the above options are correct.

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

A - ToType

B - ToSbyte

C - ToSingle

D - ToString

Answer : A

Explanation

ToType() method converts a type to a specified type.

Q 4 - Which of the following operator returns the size of a data type in C#?

A - sizeof

B - typeof

C - &</a>

D - *

Answer : A

Explanation

sizeof() operator returns the size of a data type.

Q 5 - Which of the following access specifier in C# allows a child class to access the member variables and member functions of its base class?

A - Public

B - Private

C - Protected

D - Internal

Answer : C

Explanation

Protected access specifier allows a child class to access the member variables and member functions of its base class.

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 7 - Which of the following is the default access specifier of a class?

A - Private

B - Public

C - Protected

D - Internal

Answer : D

Explanation

Default access specifier for a class type is Internal.

Q 8 - The assignment operators cannot be overloaded.

A - true

B - false

Answer : A

Explanation

The assignment operators cannot be overloaded.

Q 9 - Which of the following preprocessor directive allows generating an error from a specific location in your code in C#?

A - define

B - region

C - line

D - error

Answer : D

Explanation

#error − It allows generating an error from a specific location in your code.

Q 10 - The System.SystemException class is the base class for all predefined system exception in C#?

A - true

B - false

Answer : A

Explanation

The System.SystemException class is the base class for all predefined system exception.

csharp_questions_answers.htm
Advertisements