Infosys Interview Question

basic java and 1 coding question.