Vidyalelo
C# Programming · all questions

Classes and Objects in C Sharp
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

238

Questions

2/12

Page

Pick an option on a question to see the right answer and solution.

What is the default access modifier for class members in C# if no access modifier is specified?

Select an option to see the answer and solution.

What is the purpose of the readonly keyword when applied to a field in a class in C#?

Select an option to see the answer and solution.

In C#, what is the method called automatically when an object is no longer in use and is being destroyed?

Select an option to see the answer and solution.

What is the process of creating a new class based on an existing class in C# called?

Select an option to see the answer and solution.

In C#, what is the keyword used to explicitly call a base class constructor from a derived class constructor?

Select an option to see the answer and solution.

What is the concept in OOP that allows a class to have more than one method with the same name but different parameters in C#?

Select an option to see the answer and solution.

In C#, which method is automatically called when an object is created to initialize the object's state?

Select an option to see the answer and solution.

What is the keyword used to create an alias for a data type in C#?

Select an option to see the answer and solution.

In C#, what is the process of defining a new class within another class called?

Select an option to see the answer and solution.

What is the access modifier used to declare a class member that is accessible only within its own class in C#?

Select an option to see the answer and solution.

In C#, what is the keyword used to create a reference to the current instance of a class?

Select an option to see the answer and solution.

In C#, what is the method called automatically when an object is no longer referenced and is ready to be removed from memory?

Select an option to see the answer and solution.

What is the default access modifier for a class in C# if no access modifier is specified?

Select an option to see the answer and solution.

In C#, which keyword is used to declare a method that can be overridden by a derived class?

Select an option to see the answer and solution.

In C#, what is the method used to explicitly release resources allocated by an object?

Select an option to see the answer and solution.

What is the access modifier used to declare a class member that is accessible only within its own class and any class derived from it in C#?

Select an option to see the answer and solution.

In C#, which keyword is used to explicitly call a base class constructor from a derived class constructor?

Select an option to see the answer and solution.

In C#, what is the method called automatically when an object is created to initialize the object's state?

Select an option to see the answer and solution.

What is the concept in OOP that allows a class to have more than one constructor in C#?

Select an option to see the answer and solution.

What is the keyword used to create an instance of a class in C#?

Select an option to see the answer and solution.