My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

FEATURES OF OBJECT-ORIENTED PROGRAMS

Olabisi Yusuf's photo
Olabisi Yusuf
·Jun 12, 2020

What are Object-Oriented Programs (OOPS)? Object-Oriented Programs are a classification of programs that combines a group of related variables and functions into a unit called objects. These variables are known as properties (This term describes one or two functions depending on the desired program behaviour i.e. a 'getter' that retrieves a value and a 'setter' that sets a value.) and the functions as methods (These are functions attached to specific classes or instances in object-oriented programming.).

The four features of OOPS are:

Encapsulation: This is the action of enclosing something in or as if in a capsule. Therefore, encapsulation in OOPS is the safeguarding of the banded data and functions that manipulate the data from outside intrusion and misappropriation.

Abstraction: This is the process of considering something independently of its associations or attributes that enables the user to implement more complex logic on top of the provided abstraction without understanding or even thinking about all the hidden complexity (i.e. the user does not need to worry about how it works but only about the result and its accuracy.)

Inheritance: This is the action of receiving characteristics and behaviour of a thing or otherwise. It is a mechanism in which one class acquires the property of another class. E.g. a child inherits the traits of his/her parents. Hence, it facilitates reusability of the fields and methods of the existing class.

Polymorphism: This is the condition of occurring in several different forms. In OOPS it allows routines to use variables of different types at different times, the ability to process objects differently depending on their data type or class. More specifically, it is the ability to redefine methods for derived classes.

References: (stackify.com/oop-concept-abstraction/#:~:te..'s%20a%20very%20generic%20concept,everywhere%20in%20the%20real%20world.) (en.wikipedia.org/wiki/Object-oriented_progr..)