This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
What does the colon (:) character indicate in the declaration of a derived class in C#?
:
It indicates that the derived class is implementing an interface.
It indicates that the derived class is defining a new property or method.
It indicates that the derived class is inheriting from a base class.
What is the effect of the sealed keyword in C# inheritance?
sealed
It allows a method to be overridden in derived classes.
It allows a class to be used as a base class for other classes.
It prevents a class or class member from being inherited or overridden.
What is the purpose of using the new keyword when defining members in a derived class?
new
To hide base class members intentionally or to avoid accidental overriding of base class members.
To create a new instance of the derived class.
To override the base class members with the same name.
What is the purpose of the override keyword in C#?
override
It indicates that the member has no implementation and must be overridden in a derived class.
It indicates that the base class member is extended or modified in the derived class.
It indicates that the derived class hides members of the base class with new implementations.
What is the purpose of the base keyword in a derived class?
base
To access derived class members from a base class.
To access base class members from a derived class.
To specify which derived-class constructor should be called when creating instances of the base class.
What is the primary purpose of implementing base and derived classes in C#?
To reduce the amount of code needed for each class.
To establish a hierarchy of classes that share common attributes and behaviors.
To create multiple instances of the same class.
You must answer all questions before checking your work.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?