Beruflich Dokumente
Kultur Dokumente
The difference between procedures in general and an object's method is that the latter,
being associated with a particular object, may access or modify the data private to that
object in a way consistent with the intended behavior of the object. Consequently, rather
than thinking "a method is just a sequence of commands", a programmer using an object-
oriented language will consider a method to be "an object's way of providing a service"
(its "method of doing the job", hence the name); a method call is thus considered to be a
request to an object to perform some task.
Types of methods
As mentioned above, instance methods are associated with an object, while class or
static methods are associated with a class. The object-oriented programming paradigm
intentionally favors methods for each and every means of access to the underlying data -
from its creation, initialization, retrieval and modification to its ultimate "destruction".