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.

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 type of a class in C#?

A - sizeof

B - typeof

C - &</a>

D - *

Answer : B

Explanation

typeof() operator returns the type of a class.

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

A - Protected Internal

B - Private

C - Protected

D - Internal

Answer : A

Explanation

Protected Internal access specifier allows a class to hide its member variables and member functions from other class objects and functions, except a child class within the same application.

Q 7 - Which of the following is the default access specifier of a class member function?

A - Private

B - Public

C - Protected

D - Internal

Answer : A

Explanation

Default access for the class member function is Private.

Q 8 - The comparison operators can be overloaded.

A - true

B - false

Answer : A

Explanation

The comparison operators can be overloaded.

Q 9 - Which of the following preprocessor directive specifies the end of a conditional directive in C#?

A - elif

B - endif

C - if

D - else

Answer : B

Explanation

#endif − Specifies the end of a 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