Bank of America interview question

Basic java and oops concepts