EY interview question

Simple core java questions