NTT DATA interview question

Java basics and coding