Skip to main content
Browse topics

Kotlin Basics

Kotlin Operators

Arithmetic, relational, logical, assignment and Kotlin's special operators.

Kotlin OperatorsArithmetic Operators (Mathematical Operators) in KotlinArithmetic Operators (Mathematical Operators) explained in Kotlin, with a complete example program, its sample output, and a clear code walkthrough.Kotlin OperatorsAssignment Operators and Augmented Assignment Operators in KotlinAssignment Operator is nothing but the "equal to - =" operator. A Kotlin example with source code and sample output.Kotlin OperatorsComparison Operators in KotlinComparison operators are used for comparing numbers. A Kotlin example with source code and sample output.Kotlin OperatorsElvis Operator (?:) in KotlinThis operator is used for null safety in Kotlin. A Kotlin example with source code and sample output.Kotlin OperatorsEquality Operators (==, !=) and Referential equality Operators...The equality operators are operators that check if the values that are compared are equal. A Kotlin example with source code and sample output.Kotlin OperatorsIn Operator (in and !in) in KotlinIn operators are mainly used in when statements or expressions to check if a value falls in a range or a collection.Kotlin OperatorsIndexed Access Operator [, ] in KotlinThis operator replaces the ".get" method of lists and maps in Java. A Kotlin example with source code and sample output.Kotlin OperatorsIs Operator (is and !is) in KotlinIs operators are used to check if a variable is of a particular type or not(!is) in Kotlin. A Kotlin example with source code and sample output.Kotlin OperatorsKotlin Operators Overview in KotlinOperators Overview explained in Kotlin, with a complete example program, its sample output, and a clear code walkthrough.Kotlin OperatorsLogical Operators in KotlinThese operators are used mainly to check conditions. A Kotlin example with source code and sample output.Kotlin OperatorsNot Null Assertion(!!) Operator in KotlinThis operator converts the type of a boxed variable to not-null type. A Kotlin example with source code and sample output.Kotlin OperatorsRange Operator (..) in KotlinThis operator is used to mention a range of values inclusive of the from and to values. A Kotlin example with source code and sample output.Kotlin OperatorsSafe Call Operator (?.) in KotlinThis operator helps in writing a program without NPEs (Null Pointer Exceptions) and is represented by (?.). A Kotlin example with source code and sample output.Kotlin OperatorsUnary Operators (Sign, Inverts, Increment, and Decrement) in KotlinUnary Operators (Sign Inverts Increment and Decrement) explained in Kotlin, with a complete example program, its sample output, and a clear code walkthrough.kotlin operatorsOperator Function Overloading in KotlinKotlin lets you define how custom types respond to operators like + or ==. A Kotlin example with source code and sample output.

Related topics

Search tutorials