English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i heared that "Data Encapsulation is a technique used to protect the informations in an object/class from other objects/classes "
is it true? how is it possible in oops?

2007-02-03 21:26:36 · 4 answers · asked by mrexclusiv 1 in Computers & Internet Programming & Design

4 answers

As u said is right. Data encapsulation is a technique used to protect the information in an object from the other object.

real time example : TV operation
it is encapsulated with cover and we can operate with remote and no need to open TV and change the channel. here everything is in private except remote so that any one can access not to operate and change the things in TV

2007-02-05 15:43:20 · answer #1 · answered by Rishi 3 · 0 0

Data Encapsulation tecnique is only used with Object Oriented Programming, in this technique a class is having object(s) which only gives the functionality of that class but not the detail of the procedure followed by the function in the class.
Let's take example of Car and Car Manufacturer
Suppose you are a Car Manufacturer and you designed and developed a car design(class), now by using machinery you are manufacturing a car(object) for selling, when you sell your car the user only learn how to use the car but not that how this car works.
This means that You are creating the class with function and by making object(capsule) of it you are making availability of the functionality of you class by that object and without the interference in the original class.

Now some Programming level discription:
All the OOP programming languages such as C++, C#, Java
etc is having a concept of class and instance/object of a class, you can implement encapsulation by creating a class with some
functions and then create the object of that class, and acess the functionality of the functions of that class through object of that
class.

All this is encapsulation and this is most basic property of a object oriented programming paradigm.

Note: Encapsulation is only, can be used in Object Oriented Programming Paradigm, not in non-OOP paradigm.

2007-02-04 00:11:25 · answer #2 · answered by Vipin 1 · 0 0

We don't share any info about that. This the verybest example of encapsulation.

2007-02-03 21:34:36 · answer #3 · answered by Anonymous · 0 0

Encapsulation Real Time Example

2017-02-22 08:08:05 · answer #4 · answered by ? 3 · 0 0

fedest.com, questions and answers