What is difference between static method and instance method. which one one is better in terms of memory and performance.
Joined: Oct 13, 2005
Static methods have nothing to do with performance or memory management. They affect different things. A static member:
Is typed by the compiler
Is not polymorphic
Cannot be overridden, only hidden
Belongs to the class, not the object
There is only one copy of it per class
Every object of that class has access to the same static member
Static methods cannot access instance methods or instance fields.
Joined: Aug 08, 2007
all depend on of the your objective, but static method, this pertence the class and instance method pertence the an object, this do not have relation with a class. in terms of perfomance nothing change.