Encapsulation is the process of binding together the data and functions in a class. It is applied to prevent direct access to the data for security reasons. The functions of class are applied for this purpose. For example, the net banking facility to the customers allows only the authorized person with the required login id and password to get access and that too only for his/her part of the information in the bank datasource.