Content deleted Content added
provide a more complete explanation in the first paragraph instead of speaking in tongues Tag: references removed |
data -> state data |
||
Line 1:
{{short description|Computer function or subroutine that is tied to a particular instance or class}}
A '''method''' in [[object-oriented programming]] (OOP) is a [[Procedure (computer science)|procedure]] associated with a [[Message passing|message]] and an [[Object (computer science)|object]]. An object consists of ''state data'' and ''behavior''; these compose an [[Interface (computing)|''interface'']], which specifies how the object may be utilized by any of its various consumers. A method is a behavior of an object parametrized by a consumer.
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.
|