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.
Q 1 - Which of the following is correct about variable naming conventions in C#?
A - It should not be a C# keyword.
B - It must not contain any embedded space or symbol such as? - + ! @ # % ^ & * ( ) [ ] { }
Answer : C
Explanation
Both of the above options are correct.
Q 2 - Which of the following is correct about dynamic Type in C#?
A - You can store any type of value in the dynamic data type variable.
B - Type checking for these types of variables takes place at run-time.
Answer : C
Explanation
Both of the above options are correct.
Q 3 - Which of the following converts a type (integer or string type) to date-time structures in C#?
Answer : D
Explanation
ToDateTime() method converts a type (integer or string type) to date-time structures.
Q 4 - Which of the following operator casts without raising an exception if the cast fails in C#?
Answer : C
Explanation
as operator casts without raising an exception if the cast fails.
Q 5 - Which of the following statements is correct about access specifiers in C#?
A - Encapsulation is implemented by using access specifiers.
B - An access specifier defines the scope and visibility of a class member.
Answer : C
Explanation
Both of the above statements are correct.
Q 6 - Which of the following is correct about null coalescing operator in C#?
A - The null coalescing operator is used with the nullable value types and reference types.
Answer : D
Explanation
All of the above statements are correct.
Q 7 - Which of the following is the correct about class member functions?
Answer : C
Explanation
Both of the above options are correct.
Q 8 - Which of the following is the correct about interfaces in C#?
A - Interfaces are declared using the interface keyword.
Answer : C
Explanation
Both of the above options are correct.
Answer : A
Explanation
You can define one namespace inside another namespace. You can access members of nested namespace by using the dot (.) operator.
Q 10 - Which of the following is true about catch block in C#?
B - The catch keyword indicates the catching of an exception.
Answer : C
Explanation
Both of the above options are correct.