Static vs Non static
843798May 18 2007 — edited May 22 2007Hi,
I was just not clear as to how does the compiler handle Static members.
As far as fields are concerned if they are declared static, they are created on the HEAP and are shared by all the class instances.
However, what i want to know is what happenes to the methods. I mean methods are just piece of code so why should a non-static method be instantiated for all the instances?
So, I presume that static members mean that they are created on the HEAP.
Am i right here?
Thanks
Praveen