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

Answer : D

Explanation

All of the above options are correct.

Answer : A

Explanation

When a value type is converted to object type, it is called boxing.

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 converts a type to an unsigned big type in C#?

A - ToType

B - ToUInt16

C - ToUInt32

D - ToUInt64

Answer : D

Explanation

ToUInt64() method converts a type to an unsigned big type.

Q 5 - Which of the following method helps in returning more than one value?

A - Value parameters

B - Reference parameters

C - Output parameters

D - None of the above.

Answer : C

Explanation

Output parameters method helps in returning more than one value.

Q 6 - Which of the following property of Array class in C# checks whether the Array has a fixed size?

A - IsFixedSize

B - IsStatic

C - Length

D - None of the above.

Answer : A

Explanation

IsFixedSize gets a value indicating whether the Array has a fixed size.

Q 8 - Function overloading is a kind of static polymorphism.

A - true

B - false

Answer : A

Explanation

Function overloading is a kind of static polymorphism.

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.


csharp_questions_answers.htm

Advertisements