TeamViewer interview question

Explain inheritance and encapsulation. Differences and similarities?