Beginner Object-Oriented Programming Concepts
Q25 / 100

What is the purpose of a "getter" method?

Correct! Well done.

Incorrect.

The correct answer is B) To provide controlled read access to a private attribute

B

Correct Answer

To provide controlled read access to a private attribute

Explanation

Getters expose a private field's value in a controlled way, often allowing validation or computed logic.

Progress
25/100