What will be output of this simple java program ?
Check answer below :
Answer
The static block and variables follow the order in which they appear. The variable b isn’t available to the static block. Hence, it will result in a compiler error.
© 2015 – 2016, https:. All rights reserved. On republishing this post, you must provide link to original post
#
First variable ‘b’ is defined then use reference of ‘b’ .Before using any reference ,first it is defined. so program give compile time error
#