13.1 Expression Syntax in Kotlin
The most basic expression consists of an operator, two operands and an assignment. The following is an example of an expression:
val myresult = 1 + 2
In the above example, the (+) operator is used to add two operands (1 and 2) together. The assignment operator (=) subsequently assigns the result of the addition to a variable named myresult. The operands could just have easily been variables (or a mixture of values and variables) instead of the actual numerical values used in the example.
In the remainder of this chapter we will look at the basic types of operators available in Kotlin.