Type Here to Get Search Results !

What is an access modifier in OOP?

0

 What is an access modifier in OOP?

A) A tool to increase code complexity.
B) A feature that controls the visibility of class members.
C) A method that enhances performance.
D) A type of data structure.

Answer: B) A feature that controls the visibility of class members.

Explanation: Access modifiers (like public, private, protected) are keywords used to set the accessibility of classes, methods, and variables in OOP. They determine which parts of a program can access certain members, thus enforcing encapsulation and protecting the internal state of an object.

Post a Comment

0 Comments