This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
This code produce the output b1 r1 r4 pre hawk and if I do noe extend Raptor to A then output is nothing!!! Why??? We know when a class forms the Static part will initialize but if we donot extend Raptor then also we should get the output...
A Static block is executed only when a class is loaded in JVM.
Now if you are not extending Those classes then, those classes will not be loaded into JVM. And if those classes are not loaded in JVM, then obviouslly static block is not going to be executed. And that is what happening when you extends and dont extend Raptro Class.
Note : A class is loaded into JVM only once when you first create instance of it. After that if you make second instance of that class, static block of that class won't be executed becos that class already exist in JVM.
I hope i am making my self Clear.
====================================== Enjoy(ing) The World of Programming... ======================================