A static method is a single instance of a method that exists in the heap and
is used by all client code. A non-static method is a method that is created
when an instance of a class is created, and is specific to that class. For
every instance of the class, there will be an instance of the method.
Static methods are used for operations that do not require the use of
instance members of a class. The System.Math methods are excellent examples
of this. They take parameters, perform mathematical operations on the
parameters without requireing any instance members of the Math class to do
so, and return a value to the caller without modifying the Math class in any
way.
They are useful because they conserve memory and processor resources by
virtue of there being only one copy of the method. They can be a bit tricky
though, because every instance of every class is using the same instance of
the method, and this can cause thread-related conflicts.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
A brute awe as you,
a Metallic hag entity, eat us.
"Doru Roman" <do*******@rogers.com> wrote in message
news:u5**************@TK2MSFTNGP09.phx.gbl...
Hi,
Can somebody explain please the meaning and use of a STATIC method?
Thanks,
Doru