ICSE Class 10 Computer Applications Question 16 of 25

Class as Basis of All Computation — Question 16

Back to all questions
16
Question

Question 16

How does object encapsulate its 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.