As part of this video we will discuss below things
- What’s Stream API?
- What exactly java.util.stream package consists of?
- What are the feature’s of stream?
- What are stream operations and What’s the significance of their operation?
- How Stream differs from Collections?
- How many ways we can create a stream?
- How many intermediate operations and how many terminal operations we -- can perform on a stream?
- What are intermediate operations?
- What are terminal operations?
Next we will see
- Stream API in detail with example
- Real time use case with stream API.
- Interview bits on Stream API
Terminal Operations
anyMatch()
allMatch()
noneMatch()
collect()
count()
findAny()
findFirst()
forEach()
min()
max()
reduce()
toArray() etc..
Intermediate Operations
filter()
map()
flatMap()
distinct()
sorted()
peek()
limit()
skip() etc..
How Stream differs from Collections?
Collection:
Collection is an in-memory data structure, which holds all the values that the data structure currently has.
Every element in the Collection has to be computed before we add it to the Collection. Operations such as searching, sorting, insertion, manipulation, and deletion can be performed on a Collection like List, Set, Map etc..
Stream:
On the other hand, Stream is an API that is introduced in Java 8 which is used to process collections of objects.
A stream is a sequence of objects that supports various methods which can be pipelined to produce the desired result.
The Stream API is used to process collections of objects.
A stream is not a data structure instead it takes input from the Collections, Arrays, or I/O channels.
Streams don’t change the original data structure, they only provide the result as per the pipelined methods.
java.util.Function Package link :
• 01-Predefined Functional Interface In...
Java8 link :
• 01 Lambda Expression in java
#prakashit #stream #java8stream #java8 #streamapi
On this page of the site you can watch the video online 01-Stream Interface Package overview | java.util.stream PKG | Java8 with a duration of hours minute second in good quality, which was uploaded by the user Prakash IT 27 January 2024, share the link with friends and acquaintances, this video has already been watched 91 times on youtube and it was liked by 4 viewers. Enjoy your viewing!