Welcome! No, they aren't faster. They just help make the program smaller, succinct and easier to read/maintain. Theoretically, using parallel stream can be faster than for-loop, but only if the stream has large number of elements and there are lot of filters/transforms involved.
not always, butstreams are used for better read and less boilerplate code and are used for internal commands to do something with values and then reffer them to some another date type etc.
I do not know if this was done on purpose, but there is a mistake on the first piece of code: You want if ( min > numbers[ i ] ) at 0:10 . Otherwise, you would be calculating the maximal value. But this actually shows a useful aspect of Java Streams: less mistakes while writing trivial code.
Amazing introductory video. Adding my two cents to parallel streams: Choosing between stream and parallel stream depends on various important factors and also the prerequisites. 1) Parallel streams internally uses fork-join(divide and conquer technique) to evenly distribute tasks to multiple threads to achieve parallelism. Hence the function/operation(intermediate operation) that is being performed on streams should be STATELESS(parallel friendly) else it will deteriorate the performance than a normal stream. 2) Breaking and merging of stream should be easy. For example an ArrayList is easy to break and merge than a linkedList.
Very helpful! I had 3 hours of university lectures and l didnt learn anything. I come to youtube and learned 100% of everything from the video! Thank you!
This is the best and crisp video on Streams.. covered so much in short time and your audio is also soothing to listen , Thank you for all your hard-work 🙏🙏🙏
Thanks a lot. You gave lot of information in less time as well as you did not make hurry in explanation and speaking speed. Amazing man. I just surprised that how could manage to impart good chunk of info in less time even you spoke at moderate speed, showed code examples, diagrams with explanation, simply amazing. Other good thing in your video is that you also covered Terminal operation in detail with clarity and simplicity of course here also you did it in less without loss of quality. Most of other tutorial skipped explaining Terminal operation part.
pls do continue to upload more vedioes like this.. your java concurrancy playlist helped me a lot to understand the multithreading concept.. pls do contine to upload more java indepth vedioes . thank you
Ur videos are beautifully explained,,,u have that gift,not everyone can explain with such clarity,,,,mind blowing tutorials...ND 8 dislikes are from those people's who can't understand if God comes personally to teach them...thanqqq for this again tutorial...
Very nice video to understand streams with examples. I have been following your tutorials they always been amazing with such good content. Real time examples of streams. much appreciated.
I'm simply understood the concept now very well. The way of explanation is awesome. Thanks for wonderful diagrammatic explanation to easily remember the concepts. Thank you so much Defog Tech.
I always admire of ur work. You give more info in less time with good pictorial representation. You deserve more subscribers. May be changing channel name helps. Waiting for more content...
This video is very interesting. Although! The old code to find out the minimum element from the array The "if" condition is wrong. it's < if ( min < numbers[i] ) > the expected should be < if ( min > numbers[i] ) > the code in your video will give you the maximum number.
Great Tutorial Sir!!i would like to caption it as"JAVA8 Streams API--made easy". Today on teacher's day, i take the privilege to wish you "Happy Teacher's Day".Let your guidance be always with us.Thank you!!
Strangely enough you have a mistake on your first slide. The condition for defining min value is the opposite. Other than that quite informative video - great job.
Hello thanks for wonderful and clear tutorial..worth a every second in the video. Please correct me if I am wrong, As per my understanding in stream API we can use multiple intermediate operation(lazy initialization) and single terminal Operation(eager initialization).
Agree about the lazy evaluation. Though we hardly ever pass around streams (without terminal operations), unlike Reactive Streams which are meant for that purpose. In official documentation, laziness is more about not evaluating elements which are filtered out in previous filter operation, (eg: sorting need not sort duplicate elements, if distinct() is used before it).
I have a question, suppose we have an array arr = {1, 5 ,10}; i want to check odd and even and return a string through steam API like "1o5o10e", for every odd add o and for every even number add e, How can be possible this, please.
I have a List of Java Objects, using Stream I'm trying to get a match of an object. If present then i wanna update it, else i wanna add a new Java Object into the existing List. Is there any simpler way of doing it?
Thanks for video.. is stream are faster than old for loop ? if yes why?
Welcome! No, they aren't faster. They just help make the program smaller, succinct and easier to read/maintain.
Theoretically, using parallel stream can be faster than for-loop, but only if the stream has large number of elements and there are lot of filters/transforms involved.
not always, butstreams are used for better read and less boilerplate code and are used for internal commands to do something with values and then reffer them to some another date type etc.
Even sometimes streams are slower than simple for loop if your data is not huge enough.
But debugging has got tough now a days. 😒😒
@@DefogTech it also reduces memory footsprint for intermediate operations
Let’s start with an example....! This is how this video starts, not even a single second of unnecessary content.. spot on .. exceptional 👏
I do not know if this was done on purpose, but there is a mistake on the first piece of code: You want if ( min > numbers[ i ] ) at 0:10 . Otherwise, you would be calculating the maximal value.
But this actually shows a useful aspect of Java Streams: less mistakes while writing trivial code.
Exactly, that's the usefulness of java streams.
Amazing introductory video. Adding my two cents to parallel streams:
Choosing between stream and parallel stream depends on various important factors and also the prerequisites.
1) Parallel streams internally uses fork-join(divide and conquer technique) to evenly distribute tasks to multiple threads to achieve parallelism. Hence the function/operation(intermediate operation) that is being performed on streams should be STATELESS(parallel friendly) else it will deteriorate the performance than a normal stream.
2) Breaking and merging of stream should be easy. For example an ArrayList is easy to break and merge than a linkedList.
Very helpful! I had 3 hours of university lectures and l didnt learn anything. I come to youtube and learned 100% of everything from the video! Thank you!
The best and complete tutorial I've seen about Java Streams
This is the best and crisp video on Streams.. covered so much in short time and your audio is also soothing to listen , Thank you for all your hard-work 🙏🙏🙏
I checked ur channel quiet late , but ur all videos are awesome ,easy to understand and explanation is far better than other channel , thanks
Superb and clear explanation of multiple important concepts in 15 mins.. Thanks a ton..
Thanks a lot. You gave lot of information in less time as well as you did not make hurry in explanation and speaking speed. Amazing man. I just surprised that how could manage to impart good chunk of info in less time even you spoke at moderate speed, showed code examples, diagrams with explanation, simply amazing. Other good thing in your video is that you also covered Terminal operation in detail with clarity and simplicity of course here also you did it in less without loss of quality. Most of other tutorial skipped explaining Terminal operation part.
Outstanding !!!!! the best video on streams I came across.
pls do continue to upload more vedioes like this.. your java concurrancy playlist helped me a lot to understand the multithreading concept.. pls do contine to upload more java indepth vedioes .
thank you
Ur videos are beautifully explained,,,u have that gift,not everyone can explain with such clarity,,,,mind blowing tutorials...ND 8 dislikes are from those people's who can't understand if God comes personally to teach them...thanqqq for this again tutorial...
Best video on stream api so far Thankyou very much
Very nice video to understand streams with examples. I have been following your tutorials they always been amazing with such good content. Real time examples of streams. much appreciated.
I'm simply understood the concept now very well. The way of explanation is awesome. Thanks for wonderful diagrammatic explanation to easily remember the concepts. Thank you so much Defog Tech.
Very clear explanation, thanks for your effort.
if ( min > numbers[i] ) the condition has to be min > numbers[i] . otherwise the tutorial is really good.
It was for maximum number calculation in old way.
@@rabisankarpodder7839 but he is doing min for stream example so the if logic is wrong.
min > number[i]
One of the best videos about streams. Thanks.
I always admire of ur work. You give more info in less time with good pictorial representation.
You deserve more subscribers.
May be changing channel name helps.
Waiting for more content...
Defog Tech is a great youtube channel for great explanations for Java Tech related stuff. Thanks.
One word Excellent!
Crisp and to the point as always. Keep up the good work! Really appreciate your videos 😊
Best Java Streams video. 🙏 Finally Understood stream
Awesome explanation! The figures @5:05 and @11:28 makes it so clear to understand.
Excellent work! Thank you for taking the time to put this video together and for the clear explanation it contains.
Very nicely explained
Thanks for the video, small correction find the min number in an older way, the if condition was wrong (if (number[i] < min))
This video is very interesting. Although!
The old code to find out the minimum element from the array
The "if" condition is wrong.
it's < if ( min < numbers[i] ) >
the expected should be < if ( min > numbers[i] ) >
the code in your video will give you the maximum number.
Honestly speaking, you should make a whole series of Java. Lots of good wishes to you.
Thanks for this golden content
Best for revision of java stream api
Incredibly put together and very in depth! This guy is definitely getting a subscribe from me! Thanks
You explanation is awesome. Keep going, and thank you very much for you good work.
Very clear explanation . Useful for interviews 😊😊. Thanks,🙏🙏🙏
excellent video, kudos
Good explanation 🤗
Thanks for the video.. Your tutorials are crisp and clear..
Nice explanation
thank you so much for this video, got more idea about stream api .
Great, Thank you 😘😘😘😘😘😘😘
Great Tutorial Sir!!i would like to caption it as"JAVA8 Streams API--made easy".
Today on teacher's day, i take the privilege to wish you "Happy Teacher's Day".Let your guidance be always with us.Thank you!!
Thank you for the kind words sir! Happy Teacher's Day to you too!
You are the best…awesome explanation with great examples. Thank you, Keep going.👍
with above code r u getting min number?...Did you tried above code?
Really amazing...
Very well explained. Thank you so much!!!
Great channel with precise explanation. 👍
Great tutorial. Thank you so much!
Excellent explanation ... Awesome.. Thank you so much.
awesome explaination
Awesome Presentation!!! Vivid Explanation about Java 8 Stream!! Good work👏
Thank you!
Great video
Ur an excellent teacher...keep it up 😊
Nice Explanation thanks
Great video. Very useful info. Thanks.
Thank you for the good presentation.
Very nice tutorial
Thanks for videos. Could you please load on class loader concepts
Thanks for awesome Java 8 stream video plzz add more video if possible
You're welcome! Thank you for the kind words! Will keep adding more, hopefully more frequently
Great video!
Strangely enough you have a mistake on your first slide. The condition for defining min value is the opposite. Other than that quite informative video - great job.
This video is amazing !
Thanks, good tutorial. Just a suggestion, it would be much more efficient to filter the employee first (isActive) and then sort it.
Thanks a ton for this video!!
Hello thanks for wonderful and clear tutorial..worth a every second in the video.
Please correct me if I am wrong,
As per my understanding in stream API we can use multiple intermediate operation(lazy initialization) and single terminal Operation(eager initialization).
Will the order of intermediate operations matter for stream to optimize them ?
Super...plz add more videos about java 8 features.... Advance thanks...
Yes sir, will add more soon!
Thanks for the Video...!!
this was really good :)
Awesome !!! thanks a lot
Awesome
cool put some system design question as well.
1:25 but System.out is an object, why is it then a *static* method reference?
Great👍
Respect ++ Sir !
Very clear explanation, thanks for putting it together. It seems like C# LINQ, but for Java.
Well explained..thanks
You're welcome!
Too awesome video
Very nice, thx.
Thanks for the requestes video! Much appreciated :)
You're welcome!
Thanks mate ! Another excellent video.
I have a question. I get confused on when to go for .map() method while working with streams
This is great intro to java streams..... however, how are time/space complexity calculated with Java streams?
Streams do not apply those intermediate operations until the terminal operation is not found. That's the power of streams, they are lazily evaluated.
Agree about the lazy evaluation. Though we hardly ever pass around streams (without terminal operations), unlike Reactive Streams which are meant for that purpose.
In official documentation, laziness is more about not evaluating elements which are filtered out in previous filter operation, (eg: sorting need not sort duplicate elements, if distinct() is used before it).
Thanks you so much. Keep it up please
great
I have a question, suppose we have an array arr = {1, 5 ,10}; i want to check odd and even and return a string through steam API like "1o5o10e", for every odd add o and for every even number add e, How can be possible this, please.
Waiting for your Lambda tutorial eagerly. Can you post it this week? :)
Difficult sir, I will try.. definitely on my list though
thank you
U explain concept in very much easier way . Do u have any channel on Udemy for course plz let me knw if any..
No Udemy course so far. Will start membership on UA-cam soon, and upload courses or exclusive content there. Hope it helps!
About performance: 1 order of magnitude slower stream is.
Nice presentation :) InterviewDOT
Nailed it!
Hi, Can you please share the slides as well?
thanks alot
Great videos. Request to increase the font size in the presentation. The contents are not clearly visible on mobile devices.
sure, will do.. thanks for pointing out!
In first example, the if condition is wrong.
It should be -
if(numbers[i] < min)
I noticed the same 😂
Thank you sir
I have a List of Java Objects, using Stream I'm trying to get a match of an object. If present then i wanna update it, else i wanna add a new Java Object into the existing List. Is there any simpler way of doing it?
finding min value condition is wrong (replace "for (int i = 1; i < numbers.length; i++) {
if(min>numbers[i]) {
min=numbers[i];
}
}")
Having filter and then sort is always better than having sort and then filter. Asymptotically same, but still you know what I mean 11:22 min
Hi
IntStream.range(1, 11),i want to take reverse IntStream.range(11, 2)
how can we do
Thanks