0
C# static
What is the static command for? Why isn't it used when I want to declare a method inside a class?
2 Answers
+ 1
Static means that the compiler gives the item a unique, fixed location in memory that never moves. It is not dynamically allocated or replicated at run time. A static object does not need a constructor, since there is one instance already defined in a fixed location in memory. A static variable inside a function holds its value from one call to the next, since no other portions of the code would re-use that memory.