Question: what is use of getter and setter methods in java?
Answer: In Java, getter and setter are two conventional methods that are used for retrieving and updating value of a variable. ... And a getter is a method that reads value of a variable. Getter and setter are also known as accessor and mutator in Java.