KnowledgeBoat Logo
|

Computer Applications

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?

  1. Information and operation
  2. Data members and Member methods
  3. Data members and information
  4. Member methods and operation

Objects & Classes

ICSE Sp 2024

30 Likes

Answer

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.

Answered By

17 Likes


Related Questions