Lambdas and Stream Why ?
Streams:
-
Streams brings functional Programming in Java and are supported in JAVA 8
-
Stream Pipeline consist of Source followed by ZERO or more intermediate operation with terminal operation.
- Streams can be created from Collections , Lists , Sets , ints , longs , doubles , arrays and lines of a file
Intermediate operations :
- filter, map or sort reaturn a stream so we can chain multiple intermediate operations.
Terminal operations :
- forEach, collect or reduce are either void or return a non-stream result.