Infosys interview question

OOPS concept.