Hexaware Technologies interview question

Basic java questions and 1 code to solve infront of the interviewer