Instruction

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Kotlin offers seven types of operators. They are:

  • Arithmetic operators
  • Assignment operators
  • Unary operators
  • Logical operators
  • Relational operators
  • Special operators

Using Arithmetic Operators

Arithmetic operators allow you to perform mathematical operations on values.

Using Assignment Operators

Assignment operators let you assign values to variables. = is the simplest assignment operator that allows you to assign a value, as shown below:

Using Unary Operators

Unary operators perform operations on a single operand. Kotlin offers two unary operators:

Using Logical Operators

Logical operators allow you to perform logical operations. These operations have a Boolean result, true or false. Kotlin offers three logical operators:

Using Relational Operators

Relational operators allow you to compare two values, giving you a Boolean result. The relational operators offered by Kotlin are:

Using Special Operators

In addition to the operators mentioned earlier, Kotlin offers two special operators:

See forum comments
Download course materials from Github
Previous: Introduction Next: Demo