Ericsson interview question

basic java question mixed in with design patterns