1(xviii)
Read the following text, and choose the correct answer:
A class encapsulate Data Members that contains the information necessary to represent the class and Member methods that perform operations on the data member.
What does a class encapsulate?
- (a)Information and operation
- (b)Data members and Member methods
- (c)Data members and information
- (d)Member methods and operation
Show SolutionHide Solution↓
Data members and Member methods
Reason — 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.