MagicBricks interview question

Output of java code.