Java Abstraction Encapsulation

DATA ABSTRACTION AND ENCAPSULATION

ENCAPSULATION (data hiding)

The technique of hiding the internal implementation detail of an obj from it’s external views.

Internal structure remains private and services can be accessed by other objects only through messages passed via a clearly defined interface. Encapsulation ensures that the object providing service can prevent other objects from manipulating its data or procedures directly, and it enables the object requesting service to ignore the details of how that service is provided.

ABSTRACTION

The process of reducing an object to its essence so that only the necessary elements are represented. Abstraction defines an object in terms of its properties (attributes), behaviors (functionality), and interface (means of communicating with other objects).