DEV Community

Discussion on: Why use Kotlin for Android development? Kotlin benefits, features, versions

Collapse
 
dianamaltseva8 profile image
Diana Maltseva

If I've understood you right (you mean the ability to work with streams from Java 8 and Kotlin), kotlin-stdlib provides several extension-functions for transferring Java-Stream into Kotlin-Sequence or Kotlin-List kotlinlang.org/api/latest/jvm/stdl....

If you want to know what alternative Kotlin provides Java-Streams with, collections in Kotlin "out of the box" offer operations, available in Java only when transferring collections into Stream.

To compare:

  • Java someList .stream() .map() // some operations .collect(Collectors.toList());
  • Kotlin someList .map()