- 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 - Which of the following is correct about C#?
B - It can be compiled on a variety of computer platforms.
Answer : D
Explanation
All of the above options are correct.
Q 2 - Which of the following defines boxing correctly?
A - When a value type is converted to object type, it is called boxing.
B - When an object type is converted to a value type, it is called boxing.
Answer : A
Explanation
When a value type is converted to object type, it is called boxing.
Q 3 - Which of the following converts a floating point or integer type to a decimal type in C#?
Answer : A
Explanation
ToDecimal() method converts a floating point or integer type to a decimal type.
Q 4 - Which of the following operator determines whether an object is of a certain type in C#?
Answer : B
Explanation
is operator determines whether an object is of a certain type.
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?
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 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 true about C# structures vs C# classes?
A - Classes are reference types and structs are value types.
B - Structures do not support inheritance.
Answer : D
Explanation
All of the above options are correct.
Q 8 - Which of the following is the correct about static member functions of a class?
A - You can also declare a member function as static.
B - Such functions can access only static variables.
C - The static functions exist even before the object is created.
Answer : D
Explanation
All of the above options are correct.
Q 9 - Which of the following preprocessor directive allows you to undefine a symbol in C#?
Answer : B
Explanation
#undef: It allows you to undefine a symbol.
Q 10 - Which of the following preprocessor directive lets you specify a block of code that you can expand or collapse when using the outlining feature of the Visual Studio Code Editor in C#?
Answer : B
Explanation
#region − It lets you specify a block of code that you can expand or collapse when using the outlining feature of the Visual Studio Code Editor.
To Continue Learning Please Login
Login with Google