Basic Java programming tutorials for learning Java fundamentals.
To store all the variables and methods in an object is called encapsulation. Variables are declared private to hide them and getter methods are provided to access those variables. It is concept of hiding internal functionality. It helps in improving code modularity and re usability which supports refactoring. It is also important for integrity of application to encapsulate it internal variables and methods. Below code explains process of encapsulation in depth where different objects are kept hidden
Updated 01-14-2012 at 07:39 PM by Java Basic