Created
April 12, 2016 15:09
-
-
Save kmizu/85355851b91ef389258254c5071a9fbc to your computer and use it in GitHub Desktop.
Java 8 Stream API from Scala 2.12.0-M4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(","))) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AA,BB,CC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment