Capgemini Engineering Interview Question

What is inheritance and its type and demonstrate it in a code.