Introduction to Inheritance in C++ Part 1 | C++ Tutorial | Mr. Kishore

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi this is Kishore and today we are going to discuss about inheritance concept now first of all what is called inherit actually inheritance one of the powerful feature of oops concept inheritance is now one of the most powerful concept of inheritance concept okay that is introduced it in roots with the sleeplessness now what is called inheritance inheritance is the process of inheritance is the process of deriving a new class deriving can you class our classes from existing world classes or class okay it is the process of deriving new class or classes from existing world class or classes in other words it is also called it is the process of passing the properties of passing the properties of one class to another in this situation the world class is referred as in this situation the world class is referred as base class which is also called super class base class our super class under the newly created class is called derived or sub class derived or sub class next why inheritance here the point is why in hell simple logic is there I am going to explain on small example for inheritance for example my grandfather okay already is having a building with two states okay actually my grandfather is having a building with the two states after my grandfather my father is the owner of this building that means now my father is having to stare building but actually the owner of this building is grandfather but now my father is the owner of this building why because because of his dot derived because of he is the derived when it is derived means what properties of world class here world class me grandfather our closet nucleus nucleus means what father that's why all the grandfather properties belongs to father also next for example now it's me okay here what happened my grandfather constructed a building with only two states later my father is adding one more state to this building now my father is the waller of three stay willing ok next letter it's me further answer now after the father son is the owner of this crystal building ok fine now what happened the Sun is going to add another toothpaste to this building now it is a faster building watch it here the first two states belongs to grandfather next thought said actually belongs to father and now the purple five states belongs to the Sun that means here what happened the two states are reusable reused in father and also again they are used in son that means inheritance provides the concept of reusability it is called reusability not only that one actually here we are having two states only but here three stays here five states which is called extensibility the SOI inheritance provides the concept of reusability and extensibility okay according to this example what we have to understand for example there is a class called X which is having 109 school now I made the same 100 links in another class in another class now I have to create once again the same class with hundred lines what happens the program is getting lengthy the program is getting lengthy takes more time that is why here what I am going to do means I am going to derive the white class from X square okay to prevent this problem I am going to create the white class from Express now what happens all the hundred properties are partial to white class now why also one of 100 lines and not only that one now in class why we can add another 50 lines also okay now the why is the order of 150 lines now I need all these 150 lines in jet class then same procedure from one I am going to create class child now it is having 150 lines and I can add another 50 lines that means now the class jet is up one of 200 lights here classic see using both class I and class II which is called reusability not only that one there uses under extreme leading way engine which is called extensibility that's why inheritance provides the features of reusability and extensibility that is why we need the inheritance concept and here this corn base class classics is called base class otherwise which is also called superclass now class why is called derived or subclass derived some time now class yet is what derived off JY class that is why why is the base and jetty the derived in this situation class Y is called intermediate base class in this situation it is called intermediate base class we know that actually it is the main base class from this it is design that is why it is derived that means once upon a time I am also checked but now I am having child that's why what I am parent let's say here wash it to my father to my father I am the son okay there is no doubt at all that say father is what base and what I am derived but now but now I one son that means what he derive it to me that means what I am this that is why now I am what intermediate class that is why this class derived once upon a time it is a design but right now it is having it in every class that's why it is called intermediate base class and it is now developing us okay that's why what happened instead of writing the 100 lines we can read the same concept in class why and class yet that is why our time is over and okay program length is reduced which will increases the performance of a program that is why we need the inheritance concept next how to inheritance okay how to inheritance what is the syntax for a inhale okay I am giving the inherence indexes first class it is the first we have to write derive order okay it is the derived class and : which is called inheritance operator and next public or private or protected meter bliss class and saying later members no class gloss that's all it is the syntax for the inheritance first class derived class means it is the class we are going to direct means it is the new class name and colony is called inheritance operator and it face this class is derived from this base class this class is derived from this base class next after : public or private or protected what it is called means it is called visibility mode it is called visibility mall okay next based on the visibility more this class properties behavior is dependent means actually this class is derived from this base class not this base class this base class members availability or visibility is dependent on visibility mode okay when public is used what happens when private is used what happened when protected is used what happens okay in next session I will cover what is public what is private what is protected okay thank you thank you for watching [Music]
Info
Channel: Naresh i Technologies
Views: 99,150
Rating: undefined out of 5
Keywords: Introduction to Inheritance in C++, Inheritance, Inheritance in C++, C++ Tutorial, Kishore, Naresh IT
Id: 8fDao3MBbwk
Channel Id: undefined
Length: 9min 33sec (573 seconds)
Published: Mon Apr 24 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.