It's like a twist buster at the end, you have mentioned it would work only static and method arguments should match, but the end it it worked with String::UpperCase, which creates an enthusiasm on how it worked.
I've watched many videos on the Stream API, but none have been as clear as this one. Your teaching skills and explanations are excellent. Thank you for sharing such fantastic content.😇😇
That was an awesome explanation. I have read articles about method references but I understood it after watching this video only. Thank you for the video. 👏
@SeleniumExpress I've been following this series and the content is incredibly detailed. In the third video, you introduced parallel streams, so I was expecting the next video to cover that topic. However, the latest video is on method references, which feels like a break in the flow. When will you be uploading the video on parallel streams?
Learned a lot. Big fan of your content! I have a question about method references. The main purpose seems to be code reuse. Since the methods already exist, why not just call them directly using the class name or object? For instance, instead of using a method reference like Collections::sort with an interface variable, we could just use Collections.sort() wherever needed. What specific advantages do method references offer?
Abhilash gave a great example with Collections.sort(), but method references really shine in scenarios involving the Stream API, where you often need to pass behavior as an argument. When using methods like filter(), map(), or forEach(), you need to provide a function that can be applied to each element in a stream. This is where method references or lambda expressions come in handy. They make the code more concise and readable. For example, if you want to filter a list of strings to find ones that start with a specific letter, you could use: List strings = Arrays.asList("apple", "banana", "cherry", "date"); List result = strings.stream() .filter(s -> s.startsWith("a")) .collect(Collectors.toList()); List result = strings.stream() .filter(String::isEmpty) .collect(Collectors.toList()); In such scenarios, you can't directly call Collections.sort() since it doesn't fit the functional interface expected by the Stream API methods. Instead, using method references like String::isEmpty or Collections::sort as arguments allows you to seamlessly integrate existing methods into your stream operations. So, method references are especially beneficial for improving readability and reusability when working with streams and functional interfaces. ---Thanks
you're the best teacher to teach any concept like a pro, Thank you so much for these sessions. and providing it for free.
Abhliash i have seen many youtube channel but one think i want to say u are the best and u explain everyconcept verywell with code
It's like a twist buster at the end, you have mentioned it would work only static and method arguments should match, but the end it it worked with String::UpperCase, which creates an enthusiasm on how it worked.
How
Bro your videos is really awesome. Very premium content
Thank you
I've watched many videos on the Stream API, but none have been as clear as this one. Your teaching skills and explanations are excellent. Thank you for sharing such fantastic content.😇😇
That was an awesome explanation. I have read articles about method references but I understood it after watching this video only. Thank you for the video. 👏
I think you are the best on youtube.
Loved your way of explanation. You are really a great teacher😍😇
Its very helpful brother, I need deep knowledge of exceptions and multi threading is so helpful for us if you make videos on this 2 topic
Sure, Asif ! I will gradually get you those contents.
@@SeleniumExpress Yes please. Can you make video about multithreadding?
amazing👍
Thanks a lot!! Was eagerly waiting for this. It feels like I can understand most of the things if you explain it. 👍👍
good content!!!
Hi Abhilash.. your videos are awesome... Can you take one session on generics in depth and multi threading as well
Knowledgeable video.waiting for stream api new video
First half done!
Haha, I've been using method-reference, but the light bulb just turned on! 😂😂😂😂
Thanks ❤
Please keep it up this series 🙏
Sure, More videos to come!
Thank You Abhi..😂
Nice one
Thank you abhi!!
@SeleniumExpress
I've been following this series and the content is incredibly detailed. In the third video, you introduced parallel streams, so I was expecting the next video to cover that topic. However, the latest video is on method references, which feels like a break in the flow. When will you be uploading the video on parallel streams?
1st half done
Learned a lot. Big fan of your content! I have a question about method references. The main purpose seems to be code reuse. Since the methods already exist, why not just call them directly using the class name or object? For instance, instead of using a method reference like Collections::sort with an interface variable, we could just use Collections.sort() wherever needed. What specific advantages do method references offer?
Abhilash gave a great example with Collections.sort(), but method references really shine in scenarios involving the Stream API, where you often need to pass behavior as an argument.
When using methods like filter(), map(), or forEach(), you need to provide a function that can be applied to each element in a stream. This is where method references or lambda expressions come in handy. They make the code more concise and readable.
For example, if you want to filter a list of strings to find ones that start with a specific letter, you could use:
List strings = Arrays.asList("apple", "banana", "cherry", "date");
List result = strings.stream()
.filter(s -> s.startsWith("a"))
.collect(Collectors.toList());
List result = strings.stream()
.filter(String::isEmpty)
.collect(Collectors.toList());
In such scenarios, you can't directly call Collections.sort() since it doesn't fit the functional interface expected by the Stream API methods. Instead, using method references like String::isEmpty or Collections::sort as arguments allows you to seamlessly integrate existing methods into your stream operations.
So, method references are especially beneficial for improving readability and reusability when working with streams and functional interfaces.
---Thanks
Can we expect Parallel stream next week?
This week only 👍
@@SeleniumExpress great 👍
Yes, I can use it for consumer
Hi avi your content is awesome how to by you course from Pakistan
Bro, where had you from last few months? We are waiting for you videos on java..
Hi, kindly do video on AOP
I tried to buy the microservices boot camp course on your website but it says closed. How can I buy that course. Thank you.
Hii Sir,You are from odisha
Yes, its return type is void.
Thanks abhi ❤
Welcome! 🤗
@@SeleniumExpress Could you please tell me abhi other than this stream API playlist what will be the upcoming videos ?
Please continue core java concepts abhilash
Where is the answer for how it really works?
The fake accent, is it really necessary?