Call an object method: Difference between revisions
Content added Content deleted
(Starting page) |
m (whitespace) |
||
Line 6: | Line 6: | ||
=={{header|ActionScript}}== |
=={{header|ActionScript}}== |
||
<lang actionscript> |
<lang actionscript>// Static |
||
// Static |
|||
MyClass.method(someParamater); |
MyClass.method(someParamater); |
||
// Instance |
// Instance |
||
myInstance.method(someParamater); |
myInstance.method(someParamater);</lang> |
||
</lang> |
|||
=={{header|C++}}== |
=={{header|C++}}== |
||
<lang cpp> |
<lang cpp>// Static |
||
// Static |
|||
MyClass::method(someParamater); |
MyClass::method(someParamater); |
||
// Instance |
// Instance |
||
myInstance.method(someParamater); |
myInstance.method(someParamater);</lang> |
||
</lang> |
|||
<!-- Same omits as Class page --> |
<!-- Same omits as Class page --> |
Revision as of 19:56, 16 August 2011
Call an object method
You are encouraged to solve this task according to the task description, using any language you may know.
You are encouraged to solve this task according to the task description, using any language you may know.
In object-oriented programming method is a function associated with a particular class. Methods can be static, associated with the class itself, or instance, associated with an instance of class.
ActionScript
<lang actionscript>// Static MyClass.method(someParamater);
// Instance myInstance.method(someParamater);</lang>
C++
<lang cpp>// Static MyClass::method(someParamater);
// Instance myInstance.method(someParamater);</lang>