SlideShare a Scribd company logo
INHERITANCE
INHERITANCE
OOP allows class to create new classes which
may have some common feature to the exiting
classes this is achieved by inheritance.
Inheritance is a process of creating new class
from the existing class.
The existing classes are called base class or
super class and the inherited classes are
called derived classes or sub class
Types of inheritance
1. Single inheritance
2. Multiple inheritance
3. multi-level inheritance
Single inheritance

In this case there is only 1 base and derived class and
inheritance take place between them. For ex:Class animal
{
Bones
Legs
hand
}
Class vertebrates
{
Bones
Legs
}
Multiple inheritance
If the child class interact from more than one parent class the it is called multiple inheritance.
Class aquatic animals
{
Breath in water
Gills
}
Class land animals
{
Breath in air
Lungs
}
Class amphibian
{
Breath in water
Breath in air
Lungs
Water
}
Multi-level inheritance
When a sub class is derived from a class which is derived from some other class then it is called multi –
level inheritance.
class transport
{
Fly
Sail
}
Class water transport
{
Sail
No of passenger
}
Class boats
{
sail
No of passenger
}

More Related Content

PPT
Inheritance C#
PPTX
Inheritance
PPTX
C# basics training (Inheritance)
PPT
Csharp4 inheritance
PDF
Xamarin: Inheritance and Polymorphism
PPTX
interface in c#
PPT
C#.NET
PPTX
Interfaces c#
Inheritance C#
Inheritance
C# basics training (Inheritance)
Csharp4 inheritance
Xamarin: Inheritance and Polymorphism
interface in c#
C#.NET
Interfaces c#

Similar to Inheritance in C# (20)

PDF
Lecture on Python OP concepts of Polymorpysim and Inheritance.pdf
PPTX
Inheritance.pptx
PPT
Topic inheritance
PPTX
Inheritance
PPTX
OOP-part-2 object oriented programming.pptx
PPTX
Object Oriented Design and Programming Unit-03
PPTX
Inheritance
PPTX
Aryan's pres. entation.pptx
PPT
Inheritance.ppt
PDF
INHERITANCE
PPTX
INHERITANCES.pptx
PPTX
Introduction to inheritance and different types of inheritance
PPTX
Inheritance in Object Oriented Programming
PPTX
INHERITANCE
PPTX
PPTX
Inheritance
PPTX
Inheritance in c++
Lecture on Python OP concepts of Polymorpysim and Inheritance.pdf
Inheritance.pptx
Topic inheritance
Inheritance
OOP-part-2 object oriented programming.pptx
Object Oriented Design and Programming Unit-03
Inheritance
Aryan's pres. entation.pptx
Inheritance.ppt
INHERITANCE
INHERITANCES.pptx
Introduction to inheritance and different types of inheritance
Inheritance in Object Oriented Programming
INHERITANCE
Inheritance
Inheritance in c++
Ad

Recently uploaded (20)

PPTX
BADMINTON-2ND-WEEK-FUNDAMENTAL-SKILLS.pptx
DOCX
NFL Dublin Addison Returns Home To Haunt Pittsburgh.docx
PPTX
India – The Diverse and Dynamic Country | TIDA Sports
PPTX
International Football (International football is a type of soccer in which n...
PDF
Women Rugby World Cup 2025 Tickets: Ireland’s Road to Redemption, Squad Named...
DOCX
NFL Dublin Addison Fuels Steelers-Vikings Showdown.docx
DOCX
FIFA World Cup Semi Final The Battle for Global Supremacy.docx
DOCX
NFL Dublin Vikings Turn to Speed with Tai Felton.docx
PDF
Download GTA 5 For PC (Windows 7, 10, 11)
DOCX
NFL Dublin Injury Ends Season for Former Vikings Standout.docx
PDF
Visual Performance Enhancement in Sports Optometry
PPTX
Badminton Sport group presentation pathfit
DOCX
FA Cup Final 2026 Siring: Arne Slot Crit
PDF
FIFA World Cup Scaloni Hopeful for Messi’s FIFA World Cup 2026 Participation.pdf
DOCX
How FIFA 2026 Is Changing Vancouver Before Kickoff.docx
DOCX
North Texas announced as base camps for 2026 FIFA World Cup.docx
PPTX
sports performance data analysics for sports
PDF
Best All-Access Digital Pass me .... pdf
PDF
BOOK MUAYTHAI THAI FIGHT ALEXANDRE BRECK
DOCX
FIFA World Cup Semi Final: Lionel Messi one win from crowning glory after Arg...
BADMINTON-2ND-WEEK-FUNDAMENTAL-SKILLS.pptx
NFL Dublin Addison Returns Home To Haunt Pittsburgh.docx
India – The Diverse and Dynamic Country | TIDA Sports
International Football (International football is a type of soccer in which n...
Women Rugby World Cup 2025 Tickets: Ireland’s Road to Redemption, Squad Named...
NFL Dublin Addison Fuels Steelers-Vikings Showdown.docx
FIFA World Cup Semi Final The Battle for Global Supremacy.docx
NFL Dublin Vikings Turn to Speed with Tai Felton.docx
Download GTA 5 For PC (Windows 7, 10, 11)
NFL Dublin Injury Ends Season for Former Vikings Standout.docx
Visual Performance Enhancement in Sports Optometry
Badminton Sport group presentation pathfit
FA Cup Final 2026 Siring: Arne Slot Crit
FIFA World Cup Scaloni Hopeful for Messi’s FIFA World Cup 2026 Participation.pdf
How FIFA 2026 Is Changing Vancouver Before Kickoff.docx
North Texas announced as base camps for 2026 FIFA World Cup.docx
sports performance data analysics for sports
Best All-Access Digital Pass me .... pdf
BOOK MUAYTHAI THAI FIGHT ALEXANDRE BRECK
FIFA World Cup Semi Final: Lionel Messi one win from crowning glory after Arg...
Ad

Inheritance in C#

  • 2. INHERITANCE OOP allows class to create new classes which may have some common feature to the exiting classes this is achieved by inheritance. Inheritance is a process of creating new class from the existing class. The existing classes are called base class or super class and the inherited classes are called derived classes or sub class
  • 3. Types of inheritance 1. Single inheritance 2. Multiple inheritance 3. multi-level inheritance
  • 4. Single inheritance In this case there is only 1 base and derived class and inheritance take place between them. For ex:Class animal { Bones Legs hand } Class vertebrates { Bones Legs }
  • 5. Multiple inheritance If the child class interact from more than one parent class the it is called multiple inheritance. Class aquatic animals { Breath in water Gills } Class land animals { Breath in air Lungs } Class amphibian { Breath in water Breath in air Lungs Water }
  • 6. Multi-level inheritance When a sub class is derived from a class which is derived from some other class then it is called multi – level inheritance. class transport { Fly Sail } Class water transport { Sail No of passenger } Class boats { sail No of passenger }