OOPS CONCEPTS | OBJECT ORIENTED PROGRAMMING CONCEPTS IN PYTHON PROGRAMMING

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello friends welcome back to our channel so in the previous session we have seen the dictionary concepts and today's session will discuss about the object-oriented concepts in Python programmer so pulse concept in Python so in today's session as we give you the brief introduction about these oops concept and the next session will go in depth right so now what are the concepts so we know that every programming language will be either structure oriented programming or object oriented programming so here our Python programming will support the object-oriented concepts so if it is an object-oriented concept so everything will be implemented in terms of classes and objects if it is a structure oriented programming everything will be implemented using functions now we'll go with the object-oriented concepts so what are the object-oriented concepts so the first one is class object abstraction encapsulation inheritance and polymorphism so these are the main concepts of object-oriented programming now let us start with a class yes so it is a blueprint which is followed by objects so here every class can have a multiple instances so here the instance means object so every class can have a multiple objects right so that object should follow the blueprint of the particular class so that means it is a logical structure the class can be defined as a logical structure little behavior with the behavior right so whatever the blueprint or whatever the structure we define for the class that should be followed by the objects which are created for that particular class so these are called instance of a class so object what is when by object so object is an instance of a class so here a class can have attributes and functions and abuse and functions right so attributes gives the information about the class this we can call it as a data and this we can call it as a functions so every class will be having the data and the function and if one class wants to communicate with the another class so here the communication means invoking the functions of one class to another class so communication in is meant with invoking the methods or functions which are available in one class with the another class so that communication cannot be done directly through the classes and in order to have the communication that will be done only with the help of objects so that means so with the help of object only we access the methyls of hectares with the help of an object only we can access the attributes of a class so data and function we can access the data and function to the helper function so this way too we call it as class members class members so every class will be having the data and a function right so optional sorry it may have an attribute said it may have a function but TAS can have that data Ella functions that makes a cast members so whatever the instance we are creating for this class that is called an object it may also have an attribute and functions so whatever the hata boots and functions we have created for this class all those attributes and functions are available for this object also that particular instance all right so we can access the attributes and functions with the help of object so that's what you call it as an instance of a class reference to a class so every class may have a multiple objects every class may have a multiple objects so you give an example for class and object see Cass is a logical structure and object is a physical entity so class logical structure object it's a physical entity right let us see an example student is a TAS student is a Class A student can't have a roll number mean to data that measure two variables and functions so a student can read and student can write so two functions so this is a test and every student must follow the blueprint right so here see some ABC is a name of a student that will be an object here right some 1 2 3 and name is ABC and some print function and write function so here also will be having that where that same thing our number name and also we can have a one more function branch ok one more check back but this this student that I mean this object should follow the blueprint of the corresponding class so this is called the class and this is called an object object of this student right so if our class is having the 60 students we can have a class with 60 objects so student is a class and it is having 60 objects right so hope you understood this one right next coming to this abstraction so unit will go in depth in the next session so how to create a class and how to create an object in how to access the data and the function from the class right so that we will see in the next session next abstraction abstraction means hiding the implementation details ensuring the essential videos so this is called AB structure so we'll hide the implementation part but will only show the essential part for example if you go within any software we don't know what are the functions implemented to run the operating system right or any software so just we'll install the software that means we will install the dot exe file but if we don't know what are the what are the files and how the software is implemented so that means it will hide the implementation details all the implementation details will be hidden all right only the exe file will be visible to us so if you install the exe file that particular software will be start working we don't know how how that software is implemented right so that's the small example for this abstraction so implementing the hide a I mean hiding the implementation details only showing the essential parts so this is called an abstraction so this can be implemented in object-oriented concept so you never will go with a another - right so next encapsulation encapsulation so here wrapping up of data and a function in a single entity so binding data and function into an single entity so that we can call it as an abstraction I saw the end transmission so here just now I have said that a class can have a data at the functions so that that's what I'm saying the binding up of data and functions in Gales single entity that we call it as a cash right so that's why that's how we can achieve this encapsulation so by using the access specifiers so there are three access respects so public product and product so these access specifiers can be applied for these data and functions right so one is a public private protecting public private and protected right so public means whatever the data and a function available in one caste that can be accessed by any class any function in any class right so if the data and function are specified with a public both data and functions can be accessed by any function in any case if it is a protected if it is a protected so it can be accessed by only class where it was declared or class inherited so in which case were declaring those data and functions that class only we can use those data and functions on whatever the class which is which is emitted from the base class in that class also we can use the data and functions and if it is a private these data and functions can be accessed by only the class or the class in which this data and functions are declared but also we cannot use them in the inherited terms okay so what we can inherit one class with another class so here if it is if the data and functions are accessed as a protect in a level protected then they can be accessed by the class where it is declared and also the class which is inherited from the baseness but here if it is a private it can be accessed by only one class that where these data and functions are declared right so this is how we can achieve this abstraction and encapsulation by using this access specifiers so this is called a low-level protection data production so this is a medium level and this is a high level data protection so because we are restricting the privileges we are restricting the axis of this data and functions right so hope you understood so next inheritance concept in riddles concept means the base class and derivatives so there are class can inherit the properties from the base class so you can also called as a child class and bindiya so there are class can be also called as change less this caste can also be called as changes so the dinner - inhibits the properties of a base cast so what is actually meant by this one I will give an example or we can directly write here antabuse and the functions this yes and this is the derivative is here also we are having attributes and functions right so what are the attributes and functions available in this base class all Bruce can be also accessed by the derivatives so this derived class will inherit the properties of egg biscuits the fins it will be having this dinner class will be having the same attributes and the same functions which we are using the base class and in addition to that we can have another attributes and other functions so that depends upon the there are bricks okay so this is a very - this is the change names so change class will inherit the properties of the parent class so whatever the attributes and whatever the functions we have we have declared in the parent class those can be also used by the child class itself so that is actually called as inheritance so here the inheritance can be implemented in different ways so single inheritance so multiple inheritance multi-level inheritance right so likewise a different there are different types of inheritances so we will see in depth in the further classes so but the actual inheritance concept means the acquiring the properties of a parent class by the chainrings right so hope you understood this one and then we will move on to the polymorphism see so here the inheritance completely deals with the classes there as a polymorphism will completely deals with the methods so polymer crystal means implementing same method in different context different context so here also poly in the polymorphism also there is a concept of inheritance that means how all done only in the attire in the concept of inheritance we go with the polymorphism so just now we have seen that inheritance means the parent class and the chase yes so both will be having the common attributes and the common methods because whatever the attributes and whatever the functions we are using in the parent class all those functions and data will be available with the object right that means a dinner guests right so here implementing the same method in different context so we will implement the same method in the parent class as usual as well as in the changes right so here methods with the same name implementing in different ways in different way see for example if you take the addition example he had X comma Y so here an X comma Y is a function call which takes X Y as I input so simply we can also write ad where in the function definition we can take the input values so we are not passing any arguments so here we are passing the arguments here we are not passing the arguments but this function definition will be different and this function definition will be different so implementing in different ways and one more example for better understanding c-plus consider the first so this is the automatic addition for integers and the same thing concatenation in strings right so plus is an automatic addition for integers Luis is a concatenation for strings so same operator implementation is different in different context so here it is implementing as an automatic addition there is improvement in a concatenation so implementing the same method in a different context in different contexts so the such type of things we call it as a polymorphism so this completely deals with the methods and in the end s completely deals with the classes so one casts another class there are class and obesity is parent class changeless and here also the polymorphism will be implemented in the inheritance concept so whereas the methods will be having the same name but the both they will be implemented in different context right so these are all about the object-oriented concepts right so class object abstraction encapsulation inheritance and the polymorphism so I have just given the over you so for the better understanding so in the next session we'll go in depth with tasks and object so we will see in the next session how to create a class how to create an object and we are saying that every class will be having the task numbers that is a data at a function and in order to access those methods we need an instance for the task that we call it as an object so we have to create an object so in the next session we'll see with this two concepts cash in object so how to create a cash how to create an object and how to access the class members right so if you are having any doubts regarding these loops concepts feel free to post your doubts in the comment section so that I will definitely try to clarify all your doubts and if you really understood my session like my session share my sessions with your friends and don't forget to subscribe to our channel thanks for watching thank you very much
Info
Channel: Sundeep Saradhi Kanthety
Views: 64,704
Rating: 4.9231219 out of 5
Keywords: sundeep, saradhi, kanthety, java basics, beginners, programming fundamentals, source code, object oriented, oops, oop concepts, set classpath, abstraction, inheritance, polymorphism, encapsulation, class, object, secure, virtual machine, java compiler, platform independent, portable, robust, multithreading, method overloading, method overriding, strong typed, class file, os dependent, oops example, PYTHON PROGRAMMING, PYTHON FUNDAMENTALS, interpreter, python applications
Id: MeGiAaU4lXw
Channel Id: undefined
Length: 22min 23sec (1343 seconds)
Published: Wed Sep 18 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.