Infosys interview question

Basic Java questions and one coding question