Java, Encapsulation, Programming, Software Development, Technology.
have understood the encapsulation, let me tell you in practice we can have the business logic inside the getter and setter methods of the variables of the class. Let’s see an example, public class Employee { //private fields private String name; private int empId; private long salary; //no-arg