ICSE Class 9 Computer Applications Question 9 of 10

Elementary Concepts of Objects and Classes — Question 9

Back to all questions
9
Question

Question 9

What do you understand by the term 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.