Returning data from a function

Well this is actually not possible in Kotlin. But it's possible in Android. He he, I just confused you.

Often, we want to return multiple values from a function, since there is no direct way we can use Pair and Triple.

Pair looks as follows:

Pair(100, "Hello")

Triple looks as follows:

Triple("Hello", 100, listOf(String))

The value within this parameter never holds a true meaning of member data. They can be used for any purpose, and it's perfectly fine if they do not relate to each other at all.

The first statement in this section will not confuse you; by the way, don't look for classes with name Fourth or Fifth . There are no such classes that map four or five different objects. Use some proper wrapper class, ...

Get Hands-On Serverless Applications with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.