Skip to content

Commit ec5f5bd

Browse files
committed
Fibonacci Tuples
1 parent d900a53 commit ec5f5bd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/com/java8in/action/ch5/BuildingStream.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.nio.file.Files;
99
import java.nio.file.Paths;
1010
import java.util.Arrays;
11+
import java.util.Date;
1112
import java.util.stream.Stream;
1213

1314
/**
@@ -41,6 +42,12 @@ public static void main(String[] args) {
4142
} catch (IOException e) {
4243
System.out.println("IO exception");
4344
}
45+
46+
//Stream iterate and generate
47+
48+
Stream.iterate(2, n-> n+2).limit(10).forEach(System.out::println);
49+
Stream.generate(Math::random).limit(10).forEach(System.out::println);
50+
4451

4552
}
4653

0 commit comments

Comments
 (0)