Operator overloading
Kotlin has a predefined set of operators with fixed symbolic representation (such as +
, and *
) and fixed precedence. Most of the operators are translated directly into method calls; some are translated into more complex expressions. The following table contains a list of all the operators available in Kotlin:
Operator token | Corresponding method/expression |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|