What do you mean by data encapsulation?
Data encapsulation is a bundling the data, and the methods in Java. The data or variable should always be private, but method of function may be public. If we declare variable as private then it is called data hiding.