C# - Classes and Objects Questions and Answers
Practice ModeShowing 10 of 37 questions
Q31
Which keyword restricts a method from being overridden?
Answer: Option B
Explanation: Sealed methods block overriding in derived classes.
Q32
What is a blueprint for an object?
Answer: Option B
Explanation: Classes define the structure of objects.
Q33
What is a property in C# mainly used for?
Answer: Option B
Explanation: Properties encapsulate getters and setters.
Q34
When is a destructor called in C#?
Answer: Option B
Explanation: Destructors clean up resources when an object is destroyed.
Q35
What is the function of a constructor overloading?
Answer: Option B
Explanation: Constructors with different parameters serve different initialization needs.
Q36
Which keyword is used to inherit from a base class constructor?
Answer: Option B
Explanation: base() calls parent class constructors.
Q37
Which statement about objects is true?
Answer: Option B
Explanation: Every object is stored in its own heap memory allocation.