Private Keyword

we can change the values of name and age through getters and setter then how we can say private? what is the benefit of this private?

Hi Amrit,
If we make Getters and Setters Private too in Person Class
We won’t be able to use them in another class.(Person Client Class)
I hope this resolves your doubt.
Thankyou

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.