Aventior interview question

Java Interview Question, Coding question Average,