What are the features of OOP?
Answers
Answer:
There are three major features in object-oriented programming that makes them different than non-OOP languages: encapsulation, inheritance and polymorphism.
Explanation:
Encapsulation Enforces Modularity
Encapsulation refers to the creation of self-contained modules that bind processing functions to the data. These user-defined data types are called "classes," and one instance of a class is an "object." For example, in a payroll system, a class could be Manager, and Pat and Jan could be two instances (two objects) of the Manager class. Encapsulation ensures good code modularity, which keeps routines separate and less prone to conflict with each other.
Inheritance Passes "Knowledge" Down
Classes are created in hierarchies, and inheritance allows the structure and methods in one class to be passed down the hierarchy. That means less programming is required when adding functions to complex systems. If a step is added at the bottom of a hierarchy, only the processing and data associated with that unique step needs to be added. Everything else is inherited. The ability to reuse existing objects is considered a major advantage of object technology.
Polymorphism Takes any Shape
Object-oriented programming allows procedures about objects to be created whose exact type is not known until runtime. For example, a screen cursor may change its shape from an arrow to a line depending on the program mode. The routine to move the cursor on screen in response to mouse movement would be written for "cursor," and polymorphism allows that cursor to take on whatever shape is required at runtime. It also allows new shapes to be easily integrated.
ANSWER :
Features of OOP r :
It gives stress on data items rather than functions .
It makes the complete program simpler by dividing into number of modulus .
It is highly beneficial to solve Complex problems.
❤HOPE IT HELPS ✨✨