0
What is "static" syntax? C#
what difference beetwin static methods and non-static methods in c#?
3 Respostas
+ 3
if you create 5 instances of an object each with the same static variable, changing 1 changes them all
+ 1
public static int x = 10;
"static objects or members of a class that can be accessed directly from the class, while non-static members can only be accessed from the instance it belongs to. C# follows a similar principle for the methods. static variables are used for values which cannot be stored by an instance variable."
more info: https://msdn.microsoft.com/en-us/library/98f28cdx.aspx
0
basic difference between static and non static method is the way they are called. A non static method is always called from an insurance (object) of a class. A static method is call using the class name.