Skip to main content

Kotlin Operators Overview in Kotlin

1 min read Updated June 30, 2026
Share:
On this page (5sections)

Operators Definition

In Kotlin, Operators are special symbols or characters that do some operations on variables or values. That variables or values are called as operands. which perform commonly similar functions, but which differ syntax and declaration from usual functions.

for example,

+ performs addition and returns operands added value.

a+b

here, + returns values added a and b value.

Types of Operators In Kotlin

  • Arithmetic Operators (Mathematical Operators)
  • Assignment Operators and Augmented assignment Operators
  • Unary Operators (Sign, Inverts, Increment, and Decrement)
  • Logical Operators
  • Bitwise Operators
  • Equality Operators (==, !=) and Referential equality Operators (===, !==)
  • Comparison Operators (<, >, <=, >=)
  • In Operator
  • is and !is Operators
  • Cast Operators - Unsafe (as) and Safe (as?) cast Operators
  • Indexed access Operator [, ]
  • Invoke Operator (invoke())
  • not-null assertion Operator (!!)
  • safe call operator (?.)
  • Elvis Operator (?:)
  • Reference Operator (::) (member reference or a class reference)
  • Range Operator (..)

How It Works

This Kotlin program demonstrates Operators Overview. It first prepares the data it needs, then performs the core operation step by step, and finally prints the output shown in the Sample Output above.

  1. Declare the variables that hold the program’s data.
  2. Print the final result to the console so you can compare it with the sample output.

Try changing the input values and re-running the program to see how the output changes — this is the fastest way to understand how the logic behaves.

Frequently Asked Questions

What is Operators Overview in Kotlin?
Operators Overview is demonstrated in this Kotlin tutorial with a complete, runnable example and its sample output.
How do I run this Kotlin example?
Run it in IntelliJ IDEA or Android Studio, or compile from the command line with `kotlinc file.kt -include-runtime -d file.jar` and run `java -jar file.jar`.
How can I practice Operators Overview?
Copy the example into IntelliJ IDEA or Android Studio, run it, then change the values or add print statements to see how the output changes.

Related Tutorials

Search tutorials