Infosys interview question

java basic questions