Define encapsulation is encapsulation is same as information

Define encapsulation ?is encapsulation is same as information hiding? Explain it in 200

Solution

Data encapsulation is defined as the process of wrapping up the data, and the functions into a single unit and use them.Yes it is the same as information hiding because in data encapsulation the various implementation details of a class are kept hidden from the user. This means that t he user can only perform a restricted set of operations on the hidden members of the class by executing special functions commonly called methods.This is to ensure only the public members of the class can be accessed by the class.The private members of the class can only be accessed within the class and functions within the class and not outside the class.This protects the data and hides the data.

example

The data memebers lengthbox, breadthbox,heightbox can be accessed within the class by togetvolume function.It cannot be accessed outside the class.This can be used within the class itself.

Define encapsulation ?is encapsulation is same as information hiding? Explain it in 200SolutionData encapsulation is defined as the process of wrapping up the d

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site