Cognizant Interview Question

Explain inheritance with a code.