Stream()1 Java - 스트림(Stream) 생성 빈 스트림 생성 Stream em = Stream.empty(); 컬렉션으로 부터 스트림 생성 List list = Arrays.asList(1,2,3); Stream is= list.stream(); 배열로부터 스트림 생성 Stream ss= Stream.of("1", "2", "3"); 특정 범위 스트림 생성 IntStream is = IntStream.range(1, 3); // 1,2 IntStream is = IntStream.rangeClosed(1, 3); // 1,2,3 난수를 갖는 스트림 IntStream it = new Random().ints(); it.limit(3).forEach(System.out::println); it = new Random().ints(3); it.forEa.. 2017. 3. 4. 이전 1 다음