Skip to content

Instantly share code, notes, and snippets.

@kmizu
Created April 12, 2016 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmizu/85355851b91ef389258254c5071a9fbc to your computer and use it in GitHub Desktop.
Save kmizu/85355851b91ef389258254c5071a9fbc to your computer and use it in GitHub Desktop.
Java 8 Stream API from Scala 2.12.0-M4
import java.util.stream.{Collectors, Stream}
import scala.collection.JavaConverters._
object Main {
def main(args: Array[String]): Unit = {
val stream: Stream[String] = List("A", "B", "C").asJava.stream()
println(stream.map[String]{x => x + x}.collect(Collectors.joining(",")))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment