Home > DeveloperSection > Interviews > What is the difference between static and instance methods?

Posted on    November-13-2013 11:12 PM

 C# C# 
 1 Answer(s)
  1256  View(s)
Rate this:

Sumit Kesarwani

Total Post:782

Posted on    November-13-2013 1:00 AM

A method declared with a static modifier is a static method. A static method does not operate on a specific instance and can only access static members.

A method declared without a static modifier is an instance method. An instance method operates on a specific instance and can access both static and instance members. The instance on which an instance method was invoked can be explicitly accessed as this. It is an error to refer to this in a static method.

Don't want to miss updates? Please click the below button!

Follow MindStick