Object-Oriented Programming (OOP)
Which statement correctly explains Access modifier?
- A. The practice of restricting direct access to an object's internal data to protect it from unintended interference.
- B. A design pattern that restricts the instantiation of a class to a single shared object.
- C. A keyword that controls the visibility and accessibility of a class's members, such as public or private. ✓
- D. A special method automatically invoked when an object is destroyed, used to release resources.
Correct answer
C. A keyword that controls the visibility and accessibility of a class's members, such as public or private.
Explanation
Access modifier refers to a keyword that controls the visibility and accessibility of a class's members, such as public or private.