This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
hi Anupam In this case, the variable str in main method can not access to the class R, because the str in main method belong to main method only. So, the class R use own variable str as the print result when invoked the default constructor super() in the constructor test. In you want print "Sub"