In Object Oriented Programming a method is a piece of code which knows how to deal with an object. Is it often said that a method is the actual code, while the invocation is called a message. In runtime binding languages (like Smalltalk and Objective C) the actual method for a message is what is found in runtime. The distinction blurs in languages like C++ or Java.

In most languages, a reference to the object being acted upon is given as an implicit parameter, called this or self.

Methods are often categorized in class methods and instance methods. A special kind of method is the constructor.