The code snippet compile and runs without issue, but does not wait for the coroutine to show the 'there' message. Which line of code will cause the code to wait for the coroutine to finish before exiting?kotlinfun main() = runBlocking { val task = GlobalScope.launch { delay(1000L) println('there') } println('Hello,')}

🎲 Try a Random Question  |  Total Questions in Quiz: 83  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
Kotlin Quiz — practice the complete quiz, review flashcards, or try a random question.

Kotlin MCQs For LinkedIn Skill Assessments.


The code snippet compile and runs without issue, but does not wait for the coroutine to show the 'there' message. Which line of code will cause the code to wait for the coroutine to finish before exiting?<br>kotlin<br>fun main() = runBlocking {<br> val task = GlobalScope.launch {<br> delay(1000L)<br> println('there')<br> }<br> println('Hello,')<br>}<br>