This is basic question but still i don\'t understand encapsulation concept . I did\'t understand how can we change the properties of class from other class.because whenever
ENCAPSULATION is mechanism of wrapping methods and variables together as a single unit. for example capsule i.e. mixed of several medicines.
variables of a class will be hidden from other classes as it will be declared private, and can be accessed only through the methods of their current class
To achieve encapsulation in Java − * Declare the variables of a class as private. * Provide public setter and getter methods to modify and view the variables values. * The Java Bean class is the example of fully encapsulated class.