/Stream-API-examples

Java: Stream API examples

Primary LanguageJava

Java 8: Stream API examples

Solving some tasks with Java 8: Stream API

Here I presented the possible solutions to the tasks: fast and their slow analogs in terms of memory consumption


module_1

Using: filter, findFirst, findAny, skip, limit, count

module_2

Using: distinct

module_3

Using: anyMatch, allMatch, noneMatch

module_4

Using: map, mapToInt, flatMap, flatMapToInt

module_5

Using: sorted

module_6

Using: max, min

module_7

Using: forEach, peek

module_8

Using: reduce

module_9

Using: toArray, collect

module_10

How to iterate map

module_11

Get a stream from a piece of array

module_12

Find all points in the given line

module_13

Convert multidimensional array to one-dimensional array

module_14

Fibonacci solutions

module_15

Multiply all elements by 2