Encapsulation

OOPS Concepts – Data Abstraction and Encapsulation


What is Data Abstraction?

Abstraction is the ability to generalize an object as a data type that has a specific set of characteristics and is able to perform a set of actions.

For example, you can create an abstraction of a Car with characteristics, such as color, height, and weight, and actions such as run. The characteristics are called properties, and the actions are called methods.

What is Data Encapsulation?

The wrapping up of data and functions into a single unit or class is known as Data Encapsulation.

(more…)

Object-Oriented Programming


introduction-to-oops-concepts-15-638What is Object Oriented Programming?

It is a type of programming in which programmers define not only the data type of a data structure, but also the types of operations (functions) that can be applied to the data structure. In this way, the data structure becomes an object that includes both data and functions. In addition, programmers can create relationships between one object and another. For example, objects can inherit characteristics from other objects.
One of the principal advantages of object-oriented programming techniques over procedural programming techniques is that they enable programmers to create modules that do not need to be changed when a new type of object is added. A programmer can simply create a new object that inherits many of its features from existing objects. This makes object-oriented programs easier to modify. (more…)