Infosys interview question

Basic Java questions