method (computer science)

From Lojban
Jump to navigation Jump to search

A method (or a member function) in object-oriented programming (OOP) is a subroutine associated with an object of a class that forms its interface through which the outside members of the class (other objects) can access its private members (mainly the encapsulated data). Methods define the behaviour of objects at program run time. Methods can be defined both inside and outside a class. When defined inside they are automatically inline and are bound to the class at compile time (static binding) otherwise they are bound at runtime (dynamic binding).