How Java 8 Stream API Works ? | Stream API Foundation | EP 2

preview_player
Показать описание
In this video we will learn about one of the Java 8's new features called Stream API. The java stream api introduced in java 8, changed the way we write and read java code.

Java Stream API is an absolute beast when it comes to data processing as it enables the scope of processing the data in a declarative approach. It opens a way to fusion multiple methods by doing method chaining and gives us a way to write lambda expressions as most of the Java streams methods accepts lambda as a parameter. Thus we can reduce our traditional loops/condition checks / conversion code and significantly improve our code readability.

In this Java Stream api tutorial, We will discuss about the followings :
1. Imperative vs Declarative programming using Java 8
2. How Stream API works with Animations
3. Stream API Ordering / Order of execution
4. Stream API Lazy behaviour
5. intermediate and terminal operations
6. java stream filter
7. Java stream map
8. Java stream foreach

We can consider all these thing as java's new features and invest our time learning them in details.

TIMESTAMP
------------------------
00:00 - Imperative programming
05:11- Declarative Programming using Stream
08:42 - Java stream Filter
10:23- Functional Interface : Predicate
13:08 - How Stream API's filter works ?
19:58 - Streams are Immutable
22:14 - How Java 8 Stream API works ?
25:33 - Stream API Order of execution ( Ordering )
36:57 - Java stream map()
54:25 - intermediate vs terminal operations
01:01:59 - Java Streams are Lazy
01:04:08 - stream api terminal operations - collect , count , forEach
01:14:27 - Stream api programming interview questions
01:25:11 - Stream API - limit(n)

As we have discussed, The java Stream api is not a data structure but it is used to process a collection of objects.

There are two kind of operations used in Stream API.

One type of operation is called Intermediate operation. Intermediate operations are used to perform operations like filtration of elements , element transformation to another type, limiting data in a stream pipeline etc. After performing any intermediate operation over a stream, we again get a Stream Object back.

One point to note here is , the Streams in java are lazy. They do nothing until a terminal operation invoked over them. So terminal operations are going to trigger or start a stream , helps the stream to start processing the data in the pipeline.

Methods like filter(),map(),limit() are called intermediate operations, where as the methods like forEach(),collect(),count() are called terminal operations.

Another key point to remember is , any intermediate operations that we perform over a stream doesn't modify the source stream object. So streams in java are immutable and any intermediate operations performed over a stream object returns a new stream.

The last but not the least, Once we done consuming data from a stream, the stream pipeline considered as consumed and wont be reusable again.

In this java 8 stream api foundation tutorial, we will discuss everything in detail.

For more free/paid courses visit

LINKS AND FREE LEARNING RESOURCES
========
Watch my new mock interview series for java developers

Watch my new Hello spring boot series

Watch Spring boot Hot topics

spring core

spring mvc

spring mvc intermediate

Spring JDBC

spring live project

SPRING SECURITY COURSE[NEW]

For more courses visit

Any time you are getting stuck with issues, Feel free to ask for support.

you can ping me on my Facebook page

Make sure to join my private Facebook page (Ask me here)
“SeleniumExpress - Support"

you can ask for support in my website forum

Follow me on Insta
Рекомендации по теме
Комментарии
Автор

Whenever i feel like i am not understanding any new concept I come to your channel as you teach everything in detail. I love the way you explain things. Thank you very much abhilash.

vinodkumaruttera
Автор

I started watching on 2022 to get the job. Now I'm watching as Java Developer to enhance my skills.
Thank you bro ❤❤

villagesoftwareengineer
Автор

The intermediate and terminal operations really blew my mind. I paused and am writing this comment that your videos are unbeatable. Thanks Abhilash.

nikhilraj
Автор

first-half completed. Thanks Abhilash!!

AkashRaj-gmby
Автор

Your way of Explanation is Outstanding!
Never seen this type of contents in YouTube.
I would like to request you to please try to cover most of the features which are added in JAVA 8.


Thanks a lot!🥰

Vithal_Nivargi
Автор

fantastic explanation videos ..i want more videos from you bro

trendingthoughts
Автор

Very nicely explained. Thanks a lot :)

parambharti
Автор

A consumer is a functional interface, which is used to consume some value. It will not return any value. Because it is just there to consume. That's all I was able to remember

rahulbhatanagar
Автор

you are one of the most excellent teacher keep it up abhi and can you please upload more video on spring security?

teklehaimanotatikilt
Автор

Consumer is functional interface in java.
It has accept method which can take one parameter and doesn't return any value.
Basically it consumes the value and print it internally but we can print that value by using forEach method.

Vithal_Nivargi
Автор

thanking you abhilash for make wonder full session, it help me both theoretical
and code wise ..

premkumar-jzdi
Автор

@SeleniumExpress The method limit is called short circuiting stateful since it's terminating the current process by stopping it or limiting it in-between, like a circuit breaking in-between if anything interrupts.

Here, stateless operations process each element independently, while stateful operations require some form of state or knowledge about other elements to function correctly.

santhoshchandran
Автор

I'm getting so much valuable information from all your videos. Thank you!

Your content is incredibly insightful and well-presented, making learning a truly enjoyable experience. I appreciate the effort and dedication you put into creating these videos. Keep up the fantastic work! Thanks again Avilash :)

MyHemanthKumar
Автор

2nd Half done !!! Loved the explanation😍.

rahulbhatanagar
Автор

I am a med java dev. I watched this vid for curiosity and chance of learn something new. Good content, good explanation. There is problem tough: i am at currently 37 mins, and everything was told at least 5 timea or more. Why? The first 37 mins should have been 5.

Blazsejka
Автор

i love the way abhilash explanation and music

Srikanth-kqbe
Автор

Hi abhilash great content🎉. Also is 3 part available for multiple advanced functions.

abhinavpandey
Автор

Good work and explanation . It is very good for beginners. Thanks Abhilash.
How can we get paid course of yours.
I want to take MicroService and Spring cloud course.

DiliPYadav-pnrc
Автор

Hey thank you very much. Hoping you are planning to create a Java certification course. Keep it up!

CarlosMX
Автор

Every time you bring a video, I learned a lot from them, But for stream this is very basic video.

abhishekverma
welcome to shbcf.ru