0

How to use the Elvis operator?

Jun 16, 2020 in Kotlin by Jordan

1 answers to this question.

0

The Elvis operator receives two inputs and returns the very first argument only if it is no-null, else it will return the second argument. The Elvis operators syntax is:

Fun elvisEx(arg : String){

Val value = arg : “”

}  

The primary advantage of Elvis operator is we can use it for conjunction including the safe call operator.

Jun 16, 2020 answered by Harshel

Related Questions

0 1 answers

Kotlin Lambda Example

Explain about kotlin lambda expression with example?

Jun 16, 2020 in Kotlin by Irshad
0 1 answers

Kotlin Abstract Class

What is the abstract class in kotlin?

Jun 16, 2020 in Kotlin by Irshad
0 1 answers

Kotlin Default Arguments

How the default argument in kotlin works?

Jun 16, 2020 in Kotlin by Irshad