JVM trys to load Mobile class, at that time it notices that the class Mobile has extended Phone class.So it will load Phone class .
Then it will see that Phone class has a static member .So it will assign the valuue for the static member and then it will load the class Mobile.
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !
Joined: Jan 09, 2009
The Phone constructor calls the overridden version of showDevice() before the class Mobile gets initialized.
But why the Phone constructor calls the overridden version of showDevice()? Is it because there is no instance of Phone?