ICSE Class 10 Computer Applications Question 20 of 24

Object Oriented Programming Concepts — Question 20

Back to all questions
20
Question

Question 20

What do you understand by the phrase, "Objects encapsulate state and behaviour"?

Answer

An object stores its state in member variables and exposes its behaviour through the member methods. The member methods operate on member variables and serve as the primary mechanism to interact with the object. Only the member methods which are wrapped inside the class can access the data and change its state. Hence, the state and behaviour are said to be encapsulated by the object, hiding internal state and requiring all interaction to be performed through the methods of the object.