Larsen & Toubro interview question

Java