OOPS - Object Oriented Programming FAQ
Four main principles of OOPS
- Encapsulation is the process of hiding the irrelevant information and showing only relevant information to the user.
- Encapsulation is the process of wrapping up of data and member in a class.
- Only specific method or properties can access the private member of class.
- Data Hiding through the private class access specifier.
-Increase the maintainability of the code by showing only relevant information to the User.
- Abstraction is the process of hiding the details and exposing only the essential feature of particular concept or object.
Real time example:
The process of showing the general information related to the refrigerator is called Abstraction and hiding the complex information from the user is Encapsulation.
- Inheritance is the process through which a child class obtain the feature defined its parent class.
- Used for reuse of code and eliminate redundant code.
- Single, Multilevel, Multiple and Hierarchical.
- One Interface multiple methods
- With the help of Polymorphism we can use one procedure in many ways based on our requirement.
-Method according to number and types of parameter.
-Change the functionality of operator.
-Overriding is the feature that allows derived class to provide a specific implementation of a method that is already provided its base class.