In object-oriented programming a method is a function associated with a particular class or object. In most forms of object oriented implementations methods can be static, associated with the class itself; or instance, associated with an instance of a class.

Show how to call a static or class method, and an instance method of a class.

" Class "
MyClass selector: someArgument .
" or equivalently "
foo := MyClass .
foo selector: someArgument.
 
" Instance "
myInstance selector: someArgument.
 
" Message with multiple arguments "
myInstance fooWithRed:arg1 green:arg2 blue:arg3 .
 
" Message with no arguments "
myInstance selector.
 
" Binary (operator) message"
myInstance + argument .