J.P. Morgan interview question

Core Java question basics