Cognizant interview question

Explain inheritance with a code.