0% found this document useful (0 votes)
6 views1 page

Oops 2 11

The document explains the concept of single inheritance in object-oriented programming, where a child class inherits properties from a single parent class. An example is provided with a parent class 'P' and a child class 'C', demonstrating method calls from both classes. Additionally, it includes contact information for Durgasoft.

Uploaded by

vishnu050621
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Oops 2 11

The document explains the concept of single inheritance in object-oriented programming, where a child class inherits properties from a single parent class. An example is provided with a parent class 'P' and a child class 'C', demonstrating method calls from both classes. Additionally, it includes contact information for Durgasoft.

Uploaded by

vishnu050621
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Output:

Name=durga
Age=48
Rollno=101
Marks=90

Note: In the above example when ever we are creating child class object both parent and child
class constructors got executed to perform initialization of child object

Types of Inheritance:
1. Single Inheritance:
The concept of inheriting the properties from one class to another class is known as single
inheritance.

Eg:

1) class P:
2) def m1(self):
3) print("Parent Method")
4) class C(P):
5) def m2(self):
6) print("Child Method")
7) c=C()
8) c.m1()
9) c.m2()

Output:
Parent Method
Child Method

Single Inheritance

nd
DURGASOFT, # 202, 2 Floor, HUDA Maitrivanam, Ameerpet, Hyderabad - 500038,
11  040 – 64 51 27 86, 80 96 96 96 96, 92 46 21 21 43 | www.durgasoft.com

You might also like