Infosys interview question

core java basics