Static method v/s method with static lifetime

Hi Dave,
thanks for the reply and links. I understand the difference between “static function” and “function static”. The former is the static function of class (similar to C++) and exists irrespective of the class instances while the “function static” means variables/parameters of the function are static in nature and not automatic. (not passed on the stack)
My question is slightly different and is about the methods of the class. For any class, there will be a single copy of the class methods (unlike data members for which each class instance will have separate copy). Now is the method of class (static or non-static) allocated memory when class is declared or when at least one instance of class is declared? Is the memory allocated to class method(the code of method) deallocated when memory all class instances is released and they are garbage collected or the memory still exists if there is no instance of the class? Again is this behavior different for static and non static class methods?
rgs,
-sunil