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.

//Static method on a built-in type Integer
static func Integer.Div(x, y) {
    x / y
}
 
//Instance method
func Integer.Div(n) {
    this / n
}
 
print(Integer.Div(12, 3))
print(12.Div(3))