133 Views

What is data encapsulation in OOPL?


Arnab Halder 18th Nov, 2018
Answers (2)
Akhila Nagasree 18th Nov, 2018

Hello,

Encapsulation is one of the fundamental conceps in OOP.This concept is also often used to hide the internal representation, or state, of an object from the outside. This is called information hiding. The general idea of this mechanism is simple. If you have an attribute that is not visible from the outside of an object, and bundle it with methods that provide read or write access to it, then you can hide specific information and controlbundless to the internal state of the object.

If you’re familiar with any object-oriented programming language, you probably know that these methods as getter and setter methods. As the names indicate, a getter method retrieves an attribute, and a setter method changes it. Depending on the methods that you implement, you can decide if an attribute can be read and changed, or if it’s read-only, or if it is not visible at all. As I will show you later, you can also use the setter method to implement additional validation rules to ensure that your object always has a valid state

Hope this helps....

Debosmitha Bhattacharyya Student Expert 18th Nov, 2018

Hello Arnab,

Date encapsulation is one of the basic concepts of OOPs.

It basically means to bind together data and functions that will keep it safe from outside interference and misuse of data.

So, it is also known as data hiding.

Hope this was helpful. 

Related Questions

Amity University-Noida B.Tech...
Apply
Among top 100 Universities Globally in the Times Higher Education (THE) Interdisciplinary Science Rankings 2026
Amity University-Noida M.Tech...
Apply
Among top 100 Universities Globally in the Times Higher Education (THE) Interdisciplinary Science Rankings 2026
Amity University-Noida MBA Ad...
Apply
Ranked among top 10 B-Schools in India by multiple publications | Top Recruiters-Google, MicKinsey, Amazon, BCG & many more.
Amity University-Noida BBA Ad...
Apply
Among top 100 Universities Globally in the Times Higher Education (THE) Interdisciplinary Science Rankings 2026
RV University, Mysuru | B.Tec...
Apply
World-class and highly qualified engineering faculty. High-quality global education at an affordable cost
New Horizon College BBA Admis...
Apply
UG Admissions 2026 open| NAAC ‘A’ grade | Merit-based Scholarships available.
View All Application Forms

Download the Careers360 App on your Android phone

Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile

150M+ Students
30,000+ Colleges
500+ Exams
1500+ E-books