Biton is one object oriented programming language, so it supports inheritance.
So this video will be we'll be discussing what is spight on inheritance.
So it refers to defining a new class with little or no modification to an existing class.
So a new class will get created from the existing class with the will.
Some changes are may not be having any change at all.
The new class is called a derived class, also known as the child class.
And the class from which one of the classes from which it inherits will be known as a best class or
dependent class.
So just consider this one.
We're having multiple different types of inheritances.
How many types of inheritance are there?
So five types up.
What is the first one?
There is a single inheritance.
Means what?
Means one best class and one D-Day plus.
So that is known as a single inheritance.
So here you are having the multiple inheritance.
What does it mean?
We'll be having my best classes not only to we can have more than two.
Also, we'll be having multiple best classes, but one direct class.
So this particular data class, we inherit the properties from all the best classes.
This is our hierarchical inheritance.
Only one best class and multiple derived classes here.
I've shown three direct classes.
It may be two also.
It may be five or six, maybe seven.
Also here, do it.
Having the Mitel level inheritance, what is the meaning of this multilevel inheritance?
So this is the best class.
This is a direct class and for the C being the best class and sees the direct class here.
Well, having this hybrid inheritance, what does it mean?
What is the meaning of this hybrid inheritance?
So here to see this is a one best class.
These are the Deneb classes.
And now for this deal.
This B C are the best classes.
And this is the direct class.
So that is known as that is known as Heidbrink inheritance.
So it is actually nothing, but it is hierarchical.
My DBL inheritance.
It is hierarchical, mountable inheritance.
In this way, you also can have a combination that is that is of a multiple and hierarchical inheritance.
So for multiple best classes, one did a plus.
And from one best class to the makeable derived classes.
So that can also happen.
That is known as mountable hierarchical inheritance.
So here to discuss what are the different types of inheritance is out there.
So let us go for one practical demonstration for the better understanding in decision.
We shall discuss inheritance and polymorphism, which will be observed in Biton in object oriented programming
here to define one class.
So here you have defined one class.
The name of the class is my board.
This is the constructor.
These are what type?
That is one method and can stream is out of the method.
The method.
What is a very simple verb.
Just put one print statement here and here we are having another class that is known as my pinguin who
just inheriting my board see my but my wardrobe defined here.
So it makes a good code.
So here the class has been defined and my pinguin is inheriting my board.
So like about Java here, we need to write extents or any other key.
Just within this bracket were mentioning the respective class name, the class name, which will be
mentioned within this bracket, will be known as a best class, also known as the superclass.
And this is our direct class or subclass here.
So in case of Biton, the class inheritance will be written using this particular syntax.
So this might be in Gwinn is having the respective constructed.
And here you are calling the best class constructor.
So this class will be called by this part of me thought.
And it's constructed is all is underscored, underscore in it, underscore, underscore method.
So that is a best class constructor directly.
And then one statement to get printed.
And who is this.
And can can run.
So these are the other two methods in this might be in Greenglass.
So just remember in my board, along with the constructor, we are having what type and can swim.
And in case up my pinguin we're having this constructor and along it we are having who is this and can
run.
So these two other methods that they're defining, one pinguin plus object.
So it has been defined in a very simple way.
So that means we're having this might pinguin and then we're having the PDU.
One is the object name.
So we do one dot.
What type?
This particular what date was defined in the class.
That is a my Baade as my bard has got inherited into my pinguin so my baat mehtar can be accessed from
this might pinguin object.
So that's why you want what type can be executed.
But having BGT one dot.
Having B.G. one dot.
Who is this.
So it is defined.
In case of my pinguin you can easily find in mind being green.
Who is this is defined.
But having this p.g one dot can stream it had been B.G. wondered can run.
B.G. wondered can seem.
Was defined in my class and B.G. one dot can run.
This kind can run.
Was defined in my.
And that is what type and can seem.
We are inheriting Web, we're getting this one from the best class.
That is my bird because there they are defined.
So now let me go for the execution.
My bodyguard class constructed is executing, my penguin class constructed is executing.
You can easily find that here you call the best class constructor.
So that's why the condor has gone to this.
So my world class constructor is executing has got printed at first, then my being green class constructor
is executing.
So that string has got printed.
So now it called what type.
So what type is having the string.
That is I am about.
So that has to be printed.
That has got printed.
I'm pinguin.
So now next method we call this is who is this.
So I am pinguin.
So that string has got printed.
Next week when for this can swim.
So against whom is having this string to be printed.
That is I can swim.
So I can swim has got printed.
Now we are having this can run and I can run faster.
So in this way this particular string has got printed.
So using this example, we have shown you how inheritance can be implemented in Python.
So let us go for another example here.
Having one class, the name of the class is Mike Barratt.
And here we are having.
Can fly and can swim.
So obviously Batard can fly so bad it can fly.
But Batard cannot seem so bad.
It can't swim.
I'm having another class.
That is my penguin.
We just having two methods.
The same simple.
But I can easily find that can fly self and def can swim self.
So you see we're having the same property defined here also.
OK Narcy.
So def can fly self so penguin cannot fly.
And Dave can see himself where having penguins can swim.
So now we are having one common interface that is flying bird DST.
OK, so I'm going for this bird dog can fly.
And also Bartok can swim.
So, Ed, in this particular method, we were just passing this board as input palmitate and we're calling
this Bardock can fly and Baudot can see.
So here we have defined one Petrak class object, my pilot class object and one my Pinguin class object.
So we're calling this flying part test.
We're calling this flying part test with this baat parrot, that is which is a paddock class object
and bought Penguin, which is the penguin class object.
So what did happen when we were passing this back?
Parrot.
So that is a parrot class object.
So that parrot class object can fly and parrot class object that can swim, you get executed.
So as it is allowed that this can fly and this can swim, the respective body will get executed and
respective strings are going to get printed.
But when you were passing this board Penguin, which is the mine penguin class object as input parameter
to this flying bar test.
So in that case, this board can fly and board can swim, will be operated on, this being my pinguin
class objects.
So in that case, what will happen will be getting this penguin cannot fly.
And Penguin can swim in gives off flying.
But this barred penguin I think is flying.
But desde back parrot would have been better.
Can fly and parrot cannot seem.
So you can find that how these classes are having their respective objects and objects are being passed
to this flying bar test and respectively their respective can fly and can see method will get executed.
So in this particular session we have discussed what is the how to implement the inheritance, how to
do the polymorphism in about Python.
You know what?
Object oriented programming.
Thanks for watching this video.