Kotlin Operators Overview
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 (..)
Kotlin Operators
- Kotlin Operators Overview
- Arithmetic Operators (Mathematical Operators) in Kotlin
- Assignment Operators and Augmented Assignment Operators in Kotlin
- Unary Operators (Sign, Inverts, Increment, and Decrement) in Kotlin
- Logical Operators in Kotlin
- Equality Operators (==, !=) and Referential equality Operators (===, !==) in Kotlin
- Comparison Operators in Kotlin
- In Operator (in and !in) in Kotlin
- Is Operator (is and !is) in Kotlin
- Indexed Access Operator [, ] in Kotlin
- Not Null Assertion Operator in Kotlin
- Safe Call Operator (?.) in Kotlin
- Elvis Operator (?:) in Kotlin
- Range Operator (..) in Kotlin
Read More Articles
- Declare Variables In Kotlin
- Read Data Input using Scanner in Kotlin
- Double Data type Usage and Type Conversion in Kotlin
- print and println Data Output in Kotlin
- Arithmetic Operators (Mathematical Operators) in Kotlin
- Unary Operators (Sign, Inverts, Increment, and Decrement) in Kotlin
- Equality Operators (==, !=) and Referential equality Operators (===, !==) in Kotlin
- Printing Variables and Values in Kotlin
- Float Data type Usage and Type Conversion in Kotlin
- Long Data type Usage and Type Conversion in Kotlin
- Comparison Operators in Kotlin
- Byte Data type Usage and Type Conversion in Kotlin
- Is Operator (is and !is) in Kotlin
- In Operator (in and !in) in Kotlin
- Char Data type Usage and Type Conversion in Kotlin
- Read Data Input from Command Line in Kotlin
- Assignment Operators and Augmented Assignment Operators in Kotlin
- Indexed Access Operator [, ] in Kotlin
- Read String Data Input in Kotlin
- Short Data type Usage and Type Conversion in Kotlin
- Boolean Data type Usage and Type Conversion in Kotlin
- Logical Operators in Kotlin
- Elvis Operator (?:) in Kotlin
- Repeat and Its Usage in Kotlin
- Safe Call Operator (?.) in Kotlin