[WEBINAR] Bulletproof: How Today's Business Leaders Stay on Top

Derived Class

Definition - What does Derived Class mean?

A derived class, in the context of C#, is a class created, or derived from another existing class. The existing class from which the derived class gets created through inheritance is known as base or super class.

While inheriting from base class, the derived class implicitly inherits all the members (except constructors and destructors) which it reuses, extends and modifies the behavior of the base class. The derived class overrides the properties and methods of the base class so that it represents the specialized version of base class. C# provides ability to override and hide methods of base class in derived class which makes both classes to evolve freely and maintain binary compatibility.

Techopedia explains Derived Class

Following are some of the features of derived classes in C#:

  • As in Java and unlike C++, a derived class cannot have more than one base class but can be derived from more than one interface. However, it inherits all the members of its parent base classes declared in its inheritance hierarchy, due to transitive nature of inheritance
  • Access modifiers used in the declaration statement of derived class specify the permissions to use members of its base class
  • Code in the constructor of a derived class which is executed during its creation, will be executed only after executing constructor of its base class
  • Derived class has to use the modifier, ‘override’ to declare the virtual method (declared in its base class with ‘virtual’ keyword) that has to be overridden. Only instance methods and properties can be overridden
  • Derived class can have new method that hides the virtual method declared in base (with similar signature) by using the keyword, ‘new’. To access the method in base class from derived class, ‘base’ keyword can be used
  • A class can prevent derivation by declaring it as ‘sealed’ and cannot be used as base class
  • A derived class with base class as an abstract class can be instantiated if the derived class is not declared abstract and derived class has the implementation for all abstract methods declared in the base class
This definition was written in the context of .NET
Share this:

Connect with us

Email Newsletter

Join thousands of others with our weekly newsletter

The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.