answersLogoWhite

0

While many people cite private class members as being an example of information hiding (another term for data hiding) this is not strictly true. In C++, for instance, the use of the private keyword does not hide any information, it simply limits access to that information. After all, the fact something is inaccessible does not mean it is hidden. The private keyword simply means the information has been placed in a cage but only members of the class have access inside that cage; neither the cage nor the information are hidden in any way, shape or form. The same analogy is also true of many other languages. So when we speak of data or information hiding we simply mean limiting access to that information.



In some programming languages this is also referred to as encapsulation. However, in object-oriented programming, encapsulation has another meaning altogether: it is the means by which data and the methods that operate upon that data are combined into a self-contained entity, an object. Encapsulation in this sense typically incorporates data hiding, but it is the encapsulation itself that provides the means by which that data has limited access. However, encapsulation goes beyond mere data hiding in that it also provides an interface to some or all of the hidden data. This not only allows the data to be manipulated in a highly-controllable and robust manner, but also permits the underlying data storage mechanism as well as the methods that operate upon that data to be altered without affecting the object's existing consumers. In other words, the underlying implementations may change quite drastically, but their effects are limited to the class of object itself. If you think of an object as being a protective capsule that can be internally altered without affecting the outside world, the notion of encapsulation becomes that much clearer (it is no coincidence that the verb encapsulatederives from the French noun capsule).



User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is encapsulation and data hiding in dbms?

ODBMS stands for object oriented database management system. Encapsulation in ODBMS can be defined as binding of data together.


How data hiding is achieved in java?

Data hiding in the java is achieved through the use of encapsulation.


What are the various elements of Object oriented programming?

Encapsulation, data hiding, inheritance and polymorphism.


Is it true that wrapping up of data of different types into a single unit is known as encapsulation?

Not quite. Encapsulation means to combine data and the methods that work upon that data into a single unit (an object), such that access to both the data and methods is restricted in a controlled manner. Data-hiding is fundamental to encapsulation.


What is different between inheritance and encapsulation?

wrapping up of data and function into a single unit is called encapsulation where polymorphism is the ability to take more than one form


What term in java is used to indicate that a class's internal state is hidden from its clients?

Encapsulation............Hiding the data from others


Why encapsulation does not implement information hiding in object orientation?

Encapsulation also implements data hiding in an object oriented programming design. By encapsulating various methods & data objects into a single class they can also be hidden from all the other classes. You can declare the variables and methods as private and that way you can hide the data from the other classes in the application.


What is the difference between data abstraction and encapsulation?

Data Encapsulation : It is a process of bundling the data, and the functions that use them, as a single unit( atleast in C++) . In C++ the data type "class" is used to achieve this. Data Abstraction : It is a process of exposing only the interfaces and hiding the implementation details from the user. The interface exposed will remain the same: even if the internal implementation changes. This helps the user to use the new functionality without rewriting the client that was designed for previous implementation (strictly speaking ... previous interface).


What are the main features of OOP in c plus plus?

The main features of OOP are the same regardless of the language. They are: encapsulation; data hiding; inheritance; and polymorphism.


What is the difference between structure and class?

Structures are public by default while classes are private by default. Classes are generally more beneficial as the encapsulation dictates the object's purpose, and data hiding ensures the data remains valid. But the ability to emit a structure from an object and vice versa simply adds to the overall flexibility, giving you the best of both worlds whenever needed.


What does it mean by encapsulation?

Encapsulation makes class fields private, preventing access to it from outside of the class. Essentially, this data is hidden from the rest of the program. It is possible to allow access to the fields via public methods.


Why is encapsulation called wrapping?

Encapsulation is also known as wrapping because it wraps the data in the same way as a toffee is wrapped to create a logical insulation between the data(program) & the outer world(computer).

Trending Questions
Pressing the Ctrl plus Home keys moves the insertion point to the? What are the Advantage and disadvantage of computer modernity? What kind of secondary storage does flash memory card belongs to? What is an Information security incident response procedures are? What size case fits a 15.6 screen sized laptops? What is the average time it takes a computer to locate data on the storage medium and read it called? What is the process of reducing or eliminating susceptibility to outside interference called? What would you need to know to arrange the dynasties listed on tha chart on a time line? Is the gateway zx6980-ur328 all-in-one touch desktop PC dual core? How do you convert hertz to gallons per minute? Are there myths about the plains pocket mouse? What is the difference between Informatica Router and Filter? Where Attachment line? What is the program called that you type stuff into and it says it out for you? How do you backup your iPhone to a new computer without losing everything? Can I have a running batch file continue in another batch file but have it running in the same spot as it was before just moving it in windows 7? What is advantage and disadvantage of interlace and non interlaced? How do you merge multiple cells containing multiple date in excel? What might be wrong with a pet mouse that's trembling violently doesn't seems to be eating and drinking and it seems like he doesn't want to move his hind legs and is cold to the touch? What is the best free antivirus download?