Posted on 8th May 2024
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.
STILL GOT QUERIES?