Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why are the private components of an object “hidden”?

components object private
0
Posted

Why are the private components of an object “hidden”?

0

This principle is called “information hiding” or “encapsulation” and is used to protect the user. Let us assume that an object changes its private components, while its external point of contact remains unchanged. Any user who simply needs to access the object’s external point of contact can carry on working with the object as usual. The user does not notice the change. However, if an object changes its public components, then any user who accesses these public components must take these changes into account. Every object has an identity, a status (quantity of attributes) and behavior (quantity of methods and events). The structure and behavior of similar objects are defined in a class which they share. Identity is a characteristic that differentiates each object from all other objects. Identity is often confused with having the same attribute values or with a unique name. Two different objects can have identical attribute values and still not be identical. Example: Two coffee cups are

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123