This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Following code works fine. Question is how value of av is available before completion of constructor? (I think, class members - methods and variables (except static) are available only after completion of constructor). Please correct if i am wrong.
"Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
Hi Nitin, The concept is this. Consider a base class and derived class has static initialiser block and instance initialiser block. The order of execution is as follows : === STATIC Instance Initialiser - Base STATIC Instance Initialiser - Derived Instance Initialiser - Base Parent cons. called Instance Initialiser - Derived Constructor of derived === Below is a code. Try that and you will get it.