Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumKotlinFlow cold streamsSingle-choice MCQ

What does this snippet print, demonstrating how operators and collection interact on a cold Flow?

import kotlinx.coroutines.flow.* import kotlinx.coroutines.runBlocking fun main() = runBlocking { val flow = (1..3).asFlow() .map { println("map $it"); it * 2 } println("flow built") flow.collect { println("got $it") } }