ICSE Class 10 Computer Applications Question 1 of 16

Encapsulation and Inheritance — Question 1

Back to all questions
1
Question

Question 1

How does a class encapsulate state and behaviour?

Answer

A class encapsulates state and behavior by combining data and functions into a single unit. The state of an object is represented by its member variables and behaviour is represented by member methods. By combining state and behavior within a single unit, the class encapsulates the implementation details, allowing the outside world to interact with the object through a well-defined interface.