Explain data encapsulation.
The data encapsulation is a technique that combines data and functions into a single unit called class. Here, data can be accessed through member function only present inside the class. Data encapsulation enables data hiding or information hiding.