The Main Difference between them are:
- A Method declare using Static modifier was a static method. Rest of all were Instance only.
- While defining Static Methods we can't consume any instance members of the class directly. They can only be consumed by creating the object of the class.
Non-Static members of the class can't be consumed from static blocks directly. They should be referred only by using object of the class.
Sample Example for Instance Methods and Static Methods :
int x = 100;
static int y = 200;
static void Add()
staticMethods sm = new staticMethods();
Console.WriteLine(sm.x + y);
static void Main()