Multiple choice technology programming languages

Setter is a special method, that sets property value. Used for private or protected variables or for some additional validation

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Setter methods (also called mutators) are used in encapsulation to safely modify private or protected class attributes. They allow validation logic before assignment, maintaining data integrity and preventing invalid state changes.