Maybank interview question

java programming