Infosys interview question

Basic java understanding