136k views
4 votes
True/False: When an object's internal data is hidden from outside code and access to the data is restricted to the object's methods, the data is protected from accidental corruption.

User BinaryDi
by
5.2k points

1 Answer

5 votes

Answer:

True.

Step-by-step explanation:

In object-oriented programming language, a process known as encapsulation is used for the restrictions of the internal data of a software program from the outside code, therefore preventing an unauthorized direct access to the codes. This is achieved through the use of classes.

When an object's internal data is hidden from outside code and access to the data is restricted to the object's methods, the data is protected from accidental corruption.

User John McDonald
by
4.8k points