Static vs Instance Methods

Опубликовано: 24 Июль 2026
на канале: travadi education
18
2

Static vs Instance Methods

static method
A static method in C# is a method that keeps only one copy of the method at the Type level, not the object level. That means, all instances of the class share the same copy of the method and its data. The last updated value of the method is shared among all objects of that Type.

instance method
Invoking an instance method requires that you instantiate an object and call the method on that object; an instance method operates on that instance and its data. You invoke a static method by referencing the name of the type to which the method belongs; static methods do not operate on instance data.

Instagram
  / taha_travadi  

FaceBook
  / taha.travadi.10  

Linkedin
  / taha-travadi-21001b129