Infosys Interview Question

Question was on Java programming