Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is the main function of getter and setter in java Programming?

user-image
Question added by mansoor Mansoor Shakir , Internee , JOLTA Technologies(private) Limited
Date Posted: 2016/01/12
سعد رضا ٰ
by سعد رضا ٰ , Software Engnieering , None

 

The main reason is encapsulation

Encapsulation in Java

because the function of setter uses to set a value for private variable , and function getter to get the value

 

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.