Hi,
Hope you are all doing great. Let's learn together.
Join Telegram: 📲 https://t.me/contactajoydebnath
Chapters ❤
0:00 Introduction
00:30 What are Stream, Intermediate, and Terminal Operation
08:49 Filtering Operation
18:48 Slicing Operation
22:57 Mapping Operation
28:20 Matching Operation
34:56 Finding Operation
40:54 Collect Operation
01:04:50 Stream can consume only once
Note:
Java was developed by Sun Microsystems (which is now the subsidiary of Oracle) in the year 1995. James Gosling is known as the father of Java. Before Java, its name was Oak. Since Oak was already a registered company, James Gosling and his team changed the name from Oak to Java.
Document Link -
https://docs.google.com/document/d/10...
STS Link:
https://spring.io/tools
JDK Link:
https://www.oracle.com/java/technolog...
Video Links:
Spring Playlist :
• Spring Framework
Java Videos Links :
Stream API: Intermediate & Terminal operations. -- • Stream API: Intermediate & Terminal operat...
Factory Method Design Pattern. -- • Factory Method Design Pattern. Bengali-Ep:...
How to create Immutable class in Java? Immutable Design Pattern. -- • How to create Immutable class in Java? Imm...
Object Cloning, Shallow Copy and Deep Copy. -- • Object Cloning, Shallow Copy, and Deep Cop...
Excetption, Custom Exception, throw, throws -- • Exception, Custom Exception, throw, throws...
Excetption, try, catch, finally -- • Exception, Propagation try, catch, finally...
Exception, Exception Hierarchy, Call Stack, Propagation. Bengali-Ep:22 -- • Exception, Exception Hierarchy, Call Stack...
Lambda Expression, Functional Interfaces, Anonymous Class. -- • Lambda Expression, Functional Interfaces, ...
Singleton Pattern. Lazy Instantiation for Multiple Threads.Part-2 Bengali-Ep:20 • Singleton Pattern. Lazy Instantiation for ...
Singleton Design Pattern in Java. Early & Lazy Instantiation Bengali-Ep:19 : • Singleton Design Pattern Java. Early & Laz...
HashSet, Its Methods & How It Works Internally in Java : • HashSet, Its Methods & How It Works Intern...
HashSet & How It Works Internally in Java. -- • HashSet & How It Works Internally in Java....
LinkedList,Methods & How It Works Internally in Java. -- • LinkedList, Methods & How It Works Interna...
ArrayList, ListIterator, How It Works Internally -- • ArrayList, ListIterator, How It Works Inte...
Collection Framework ---- • Collections Framework, Collection & Iterat...
'super' keyword - • 'super' keyword in Java. Bengali-Ep:13 #b...
'this' keyword - • 'this' keyword in Java. Bengali-Ep:12 #be...
Final Keyword - • Final keyword, Final variable, method, cla...
Static Keyword, Static variable, block, method, nested class - • Static keyword, Static variables, block, m...
Access Modifier. Private, Public, Default, Protected -- • Access Modifier. Private, Public, Default,...
Encapsulation, Data Hiding, Setter-Getter method, JavaBean Class -- • Encapsulation, Data Hiding, Setter-Getter ...
Like, Comment, Share, and Subscribe.
Thank you again.
Stream API.
Stream API was one of the major additions to Java 8. A Stream can be defined as a sequence of elements from a source that supports aggregate operations on them. The source can be collections or arrays that provide data to a stream.
Stream is not a data structure itself. It is a bunch of operations applied to a source. It has basically two types of operations :
Intermediate operations- These methods do not produce any results. They usually accept functional interfaces as parameters and always return a new stream. Some examples of intermediate operations are filter(), map(), etc.
Terminal operations- These methods produce some results, e.g., count(), collect() etc.
1. Filtering - The filtering operations filter the given stream and return a new stream, which contains only those elements that are required for the next operation. This is an intermediate operation.
2. Slicing- slicing operations are intermediate operations, and, as the name implies, they are used to slice a stream. It includes distinct() , limit(), skip().
3. Mapping- Mapping operations are those operations that transform the elements of a stream and return a new stream with transformed elements.Map() and flatMap() are the most commonly used methods.
4. Matching- Matching operations are terminal operations that are used to check if elements with certain criteria are present in the stream or not. Mostly three operations of matching are used : anyMatch(), allMatch(), noneMatch().
5. Finding- Finding operations are terminal operations that are used to get the matched element instead of just verifying if it is present or not. There are two basic finding operations in streams, i.e., findAny(), findFirst() .
7. Collect- It is a terminal method. We can create our own collector implementation or We can use the predefined implementations provided by the collectors class. Collectors has various methods like — toList(), toMap(), toSet(),CollectingAndThen() , groupingBy(), partitioningBy(), minBy(), maxBy() etc.