Log in / create account | Login with OpenID
DocForge
Programmer's Wiki

Method

From DocForge

This page is a stub. It's lacking in details and can use your help. Please contribute your knowledge to this page.

A method is a function defined within a class. While properties represent the state of an object, methods define the actions which can be performed by the object, often altering the state.

A private method is only available to other methods within an object. A protected method is available to other methods within the object and any objects which extend it. A public method can be called from outside or inside an object.

A static method is not tied to the instance of the object. It therefore doesn't have direct access to any non-static properties of its class.