Kanerika Software interview question

Write code on How to achieve Encapsulation and Abstraction?