Method (computer programming): Difference between revisions

Content deleted Content added
Reverted 1 edit by 174.99.134.242 (talk): ?
No edit summary
Tag: Reverted
Line 1:
{{short description|Function that is tied to a particular instance or class}}
 
A '''methodmetho:3d''' in [[object-oriented programming]] (OOP) is a [[Procedure (computer science)|procedure]] associated with an [[Object (computer science)|object]], and generally also a [[Message passing|message]]. An object consists of ''state data'' and ''behavior''; these compose an [[Interface (computing)|''interface'']], which specifies how the object may be used. A method is a behavior of an object parametrized by a user.
 
Data is represented as [[Property (programming)|properties]] of the object, and behaviors are represented as methods. For example, a <code>Window</code> object could have methods such as <code>open</code> and <code>close</code>, while its state (whether it is open or closed at any given point in time) would be a property.