- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
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 - We can use reserved keywords as identifiers in C# by prefixing them with @ character?
Answer : A
Explanation
if you want to use these keywords as identifiers, you may prefix the keyword with the @ character.
Answer : A
Explanation
Value type variables in C# are derived from the class System.ValueType.
Q 3 - Which of the following converts a type to a 32-bit integer in C#?
Answer : D
Explanation
ToInt32() method converts a type to a 32-bit integer.
Q 4 - Which of the following operator returns the type of a class in C#?
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 functions and objects?
Answer : B
Explanation
Private access specifier allows a class to hide its member variables and member functions from other functions and objects.
Q 6 - Which of the following is true about C# structures?
A - Structures can have methods, fields, indexers, properties, operator methods, and events.
B - Structures can have defined constructors, but not destructors.
Answer : D
Explanation
All of the above options are correct.
Q 7 - Which of the following is the correct about class member variables?
B - These private variables can only be accessed using the public member functions.
Answer : C
Explanation
Both of the above options are correct.
Answer : A
Explanation
The comparison operators can be overloaded.
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 try block in C#?
A - A try block identifies a block of code for which particular exceptions is activated.
Answer : C
Explanation
Both of the above options are correct.
To Continue Learning Please Login
Login with Google