Q: What is the behaviour aspect of an object represented by?
-
A
Data Members
-
B
Member Functions
-
C
Both a and b
-
D
None of these
B
Answer:
B
Explanation:
The behavior of an object in object-oriented programming is represented by its member functions (or methods), which define the actions the object can perform. Member functions encapsulate the logic that allows the object to interact, respond to messages, or carry out operations based on its current state.
Data members, on the other hand, represent the state of the object, not its behavior.
Related Topic:
Share Above MCQ