Infosys interview question

Technical question on java and some real time examples