Skip to content

Functions & Classes and OOP — English

Classes support constructors, inheritance, visibility, override, super, and self/this.

Function

Function maximum(a: integer, b: integer) -> integer:
    If a > b Then:
        Return a
    Else:
        Return b
    End
End

Class

Class Person:
    protected name: string
    Constructor(name: string):
        this.name = name
    End
    public Function label() -> string:
        Return self.name
    End
End

Class Student(Person):
    public override Function label() -> string:
        Return super.label()
    End
End
self == this