Infosys interview question

OOPS Concept