logo-MindMajix
PostKotlinKotlin
j
jordan chris

Posted on 24th July 2024|54 views

0
votes

Elvis Operator Kotlin

How to use the Elvis operator?

1 answers
Answers
P
Harshel Mike

Posted on 24th July 2024| views

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.

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo

  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos
Name
Course *
Email *
Phone Number