← Docs
kotlin-stdlib / kotlin.streams / java.util.stream.DoubleStream / toList

toList

JVM
JRE8
1.2
fun DoubleStream . toList ( ) : List < Double >
(source)

Returns a List containing all elements produced by this stream.

import java.util.stream.*
import kotlin.streams.*

fun main(args: Array<String>) {
//sampleStart
val doubleStream: DoubleStream = DoubleStream.of(1e2, 1e3, 1e4)
val doubleList: List<Double> = doubleStream.toList()
println(doubleList) // [100.0, 1000.0, 10000.0]
//sampleEnd
}
Stay in touch:
  • Contributing to Kotlin
  • Releases
  • Press Kit
  • Security
  • Blog
  • Issue Tracker
  • Brand assets
  • Careers
Supported and developed by JetBrains .
Kotlin™ is protected under the Kotlin Foundation
and licensed under the Apache 2 license .