Morningstar interview question

Bit technical Java questions for round 2.