A method is a member function in a class. The term is most commonly used with Java but actually is a general term when discussing object-oriented design. A method isn't like an ordinary procedure/function; it's part of the interface to a class. Methods are fundamental to encapsulation; the only way to modify an object should be through its methods.

In practice, in a language like C++, a method is like an ordinary function that is invisibly passed the "this" pointer (most of the time). Also, a method is allowed to access all member data inside its class and non-private data inside its base classes.

See also access specifier.
Contrast static member function

(in magic) The secret way that a magician employs to achieve the trick's effect. May involve sleight of hand, optical illusions, simple but misunderstood laws of physics and, most often, misdirection.

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.

Method is one of the four basic grabs in snowboarding and skateboarding, the other three being indy, mute, and melon. To grab method, all you have to do is grab the heelside of the board with your leading hand. This makes it one of the easiest of the four.

It is also the natural grab used for backside airs, and thus, when someone performs a backside air with a method, calling it a backside method is somewhat redundant. If you use the term backside method in normal conversation or description, you probably won't receive any criticism.

However, if you are working for a well-known magazine or website, and mistakenly use the term backside method (or frontside indy, for that matter), you will promptly receive a shitload of letters and emails declaring you incompetent. This has happened to contributors to both monsterskate.com and Thrasher magazine.

In python, a method is a function defined inside the class definition. Its first argument, by convention named "self", will get passed the object on which the method is called. The following arguments get the values with which the method was called. Otherwise, there is no real "class structure" or "method structure"; you can just use self.x to access the method (or member, or whatever) x.

Meth"od (?), n. [F. m'ethode, L. methodus, fr. Gr. meqodos method, investigation following after; meta` after + "odo`s way.]


An orderly procedure or process; regular manner of doing anything; hence, manner; way; mode; as, a method of teaching languages; a method of improving the mind.



Orderly arrangement, elucidation, development, or classification; clear and lucid exhibition; systematic arrangement peculiar to an individual.

Though this be madness, yet there's method in it. Shak.

All method is a rational progress, a progress toward an end. Sir W. Hamilton.

3. Nat. Hist.

Classification; a mode or system of classifying natural objects according to certain common characteristics; as, the method of Theophrastus; the method of Ray; the Linnaean method.

Syn. -- Order; system; rule; regularity; way; manner; mode; course; process; means. -- Method, Mode, Manner. Method implies arrangement; mode, mere action or existence. Method is a way of reaching a given end by a series of acts which tend to secre it; mode relates to a single action, or to the form which a series of acts, viewed as a whole, exhibits. Manner is literally the handling of a thing, and has a wider sense, embracing both method and mode. An instructor may adopt a good method of teaching to write; the scholar may acquire a bad mode of holding his pen; the manner in which he is corrected will greatly affect his success or failure.


© Webster 1913.

Log in or registerto write something here or to contact authors.