Question OOP-ENC-0046
MediumA class has private int age and a public setAge(int a) that rejects values below 0. What benefit of encapsulation does this show?
- A.
Run-time polymorphism
- B.
Multiple inheritance
- C.
Sign up free to see the answer and a step-by-step explanation.