Infosys interview question

basics oops,exceptions