Encapsulation helps hide implementation behind an interface.Encapsulated code has two features:
1.Instance variables are kept protected (usually with the private modifier).
2.Getter and setter methods provide access to instance variables.