Capgemini Engineering interview question

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