Anu Bhagat wrote:Hi,
doSleep() method is a static method. why it is possible to call it from run ( non static method.)
Hi Anu,
Why is it impossible? We can always call static method from non-static context right? But the other way around - calling non-static from static context is not possible!
I think you got confused with static modifier; understand that static members are class properties which are loaded by the JVM when the class is loaded; but instance members are loaded only when an instance is created. So by the time an instance is instantiated, its static members would be in place right? So no problem calling them by static members right?
Hope you are not more confused now
