Kanerika Software Interview Question

Write code on How to achieve Encapsulation and Abstraction?