Here all are static methods.All will be executed when the jvm load the class. initially the value of Value is 0. It loads the Derived class ,so the addValue() method will be executed,the value of Value is 10,and then loads the Base class now the value is 30.
Static variable has only one copy.All the instances of that class share that value.
Overriding is only for non static methods in your previous post where addValue() method was overriden in sub class but here both are static so it depends on the reference from which you are calling this method. if the reference is of type Base then base version of static method will get called.
neha, basically you are confused between the static and non static declarations. static means, at class level, only one reference. they will be initialized at the time of loading the class that means at the time of compilation. so, they can not see non static elements. in this case, both methods are static. echa class haves their own reference of the method. when super class constructor calls, it calls the super class's(of it own) reference of the addvalue method. so, the value will be 10. when base call constructor call the addvalue method, it calls its own method. so the value is 30(10+20).
if you make value non static, the static blocks can not see them. then they will shout where is the value variable is?? hope you got the point.