Larsen & Toubro interview question

basic things on java 8