Encapsulation in Java is one of the major feature . There are many definitions out there for encapsulation.He I will give you full details how encapsulation will work in Java.
What Encapsulation in Java ?
Encapsulation means arranging the data in certain order.In other way “The combining together of attributes (data) and methods (behaviour/processes) into a single abstract data type with a public interface and a private implementation. This allows the implementation to be altered without affecting the interface”.