Stream的常用方法concat
作者:互联网
import java.util.Arrays;
import java.util.stream.Stream;/*
* Stream流中的常用方法concat:用于合并两个流
* */
public class demolimit {
public static void main(String[] args) {
String[] strings = {"meiyangyang","xiyangang","lanyangyang"};
Integer[] integers = {1,2,3};
Stream stream = Stream.of(strings);
Stream stream1 = Stream.of(integers);
Stream stream2 = Stream.concat(stream,stream1);
stream2.forEach(s->System.out.println(s));
}
}
标签:常用,java,Stream,stream,stream2,concat,String 来源: https://blog.csdn.net/qq_39069718/article/details/120764212