Infosys Interview Question

Explain how inheritance is used in OOP.