Java, Encapsulation, Programming, Software Development, Technology.
variables of a class as private. Providing public setter and getter methods to modify and view the values of the variables. We can write a fully encapsulated class in Java by making all the data members of the class private. And we can use getter and setter methods to get and set the data in it.