the output of the above program should be simply hello why it is printing sum=10 first and then hello according to this output the block should be of static but i have not written static even then it is printing sum=10 first and then hello.
can you please explain me the output, the block in which sum is printing which kind of block it is??
and what is the utility of this block, i am sure it is not a static block am i right??
All the instance initializer block will be executed in the declared order after every call to super constructor (super()) and then code inside the constructor will run and hence the above ouput.
SCJP 6,SCWCD 5,SCBCD 5
Failure is not an option.
This parrot is no more. It has ceased to be. Now it's a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth