follow me on:
Facebook: https://www.facebook.com/pawans.nair.7
Instagram: https://www.instagram.com/pawan_s_nair/
Twitter: https://twitter.com/PawanNair
Linked in: https://www.linkedin.com/in/pawan-nai...
In this video, we will discuss object-oriented programming concepts
Basically, object-oriented programming has 5 major concepts:
1.Class and Object
2.Inheritance
3.Encapsulation
4.Polymorphism
5.Abstraction
Class and Object in object-oriented programming :
Class is a blueprint and whereas an object is a real-world entity
any number of objects can be created from a class and all the object will have complete access of the data and methods of a class
Inheritance in object-oriented programming :
Inheritance is a mechanism through which one object acquires all the properties and behaviors of the parent objects.
To avoid code redundancy, a derived class is developed upon a base class to achieve code reusability.
Encapsulation object-oriented programming :
Encapsulation is the mechanism that binds together code and the data, to manipulate together.
In encapsulation, the variables of the class will be hidden from other classes and can be accessed only through the methods of their current class.
Polymorphism object-oriented programming :
Polymorphism is the ability of a variable, function, or object to take on multiple forms.
Overloading of function is achieved by the usage of polymorphism.
Abstraction object-oriented programming :
Abstraction is the methodology of hiding the implemented details from the user and only providing the necessary one.
In Java, we can abstract class and interface to achieve abstraction.