A static method belongs to the class. In the context of execution of a static method it is possible that not even one instance of the class exists yet. Therefore, if you try to invoke an instance method from within an static method, the class has no way to know what particular instance of the class you are referring to.
That is why a instance method is allowed to execute a static method, but the contrary is not possible. If you want to invoke a instance method from whithin the static method you must create the instance first.
All you need to understand is that static method acts over the class, and not over any particular instance of the class. While an instance method acts over a particular instance. [ December 20, 2006: Message edited by: Edwin Dalorzo ]
posted 11 years ago
Thank You Edwin
" End Less Journey ---> Learning "
We should throw him a surprise party. It will cheer him up. We can use this tiny ad: