Getter and Setter in Java
In Java, Getter and Setter are methods used to protect your data and make your code more secure. Getter and Setter make the programmer convenient in setting and getting the value for a particular data type. Getter in Java: Getter returns the value (accessors), it returns the value of data type int,