This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
(d) The program will compile without errors and will print out |R1b| once and |R2| twice, in some order, every time the program is run.
Why does "|R2|" print if it doesn't have a run() method? or better yet why does it not need its own run() method for it to print out? Why will "|R2|" print out twice? The author says it will print out in some order- which makes me wonder how is it that it can print in random order? I thought the constructors will be used as they appear from the top down like an instance initializer block.