OnJava8-Examples/streams/StreamOfStreams.java

18 lines
470 B
Java
Raw Normal View History

// streams/StreamOfStreams.java
2015-11-14 16:18:05 -08:00
// <20>2016 MindView LLC: see Copyright.txt
import java.util.stream.*;
public class StreamOfStreams {
public static void main(String[] args) {
Stream.of(1, 2, 3)
.map(i -> Stream.of("Gonzo", "Kermit", "Beaker"))
.map(e-> e.getClass().getName())
.forEach(System.out::println);
}
}
/* Output:
java.util.stream.ReferencePipeline$Head
java.util.stream.ReferencePipeline$Head
java.util.stream.ReferencePipeline$Head
*/