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 : B

Explanation

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

Q 3 - Which of the following converts a type to a small floating point number in C#?

A - ToInt64

B - ToSbyte

C - ToSingle

D - ToInt32

Answer : C

Explanation

ToSingle() method converts a type to a small floating point number.

Q 4 - Which of the following operator represents a conditional operation in C#?

A - ?:

B - is

C - as

D - *

Answer : A

Explanation

?: operator represents a conditional operation.

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 8 - Function overloading is a kind of static polymorphism.

A - true

B - false

Answer : A

Explanation

Function overloading is a kind of static polymorphism.

Answer : C

Explanation

Both of the above options are correct.

csharp_questions_answers.htm
Advertisements