Here if you notice, we have used the async{} which returns an instance of Deferred<T> , which has an await() function that returns the result of the coroutine like we have future in Java in which we do future. get() to the get the result.
Read moreWhat is await in coroutines in Kotlin?
Series – Kotlin coroutines Async/await is a common feature in many languages (naming might vary), that allows you to execute functions asynchronously while waiting for their results at a later point .2 Ağu 2020
Read moreWhat is async Kotlin?
A coroutine is a concurrency design pattern that you can use on Android to simplify code that executes asynchronously . Coroutines were added to Kotlin in version 1.3 and are based on established concepts from other languages.
Read moreWhat is async await How is it different from coroutines?
The main difference between them is that while Async/await has a specified return value, Coroutines leans more towards updating existing data .
Read more