Method Reference in Java 8 ♨️ | Explained With Examples | Interview QA | JavaTechie
HTML-код
- Опубликовано: 25 дек 2022
- In this tutorial, we will see what are Method references and how can we use it with Detailed Explanation
#JavaTechie #java8
java 8 complete class : • Java 8 complete tutori...
Spring boot microservice Live course Just started (Recordings available)
Hurry-up & Register today itself!
COURSE LINK : javatechie5246.ongraphy.com/
PROMO CODE : Java40
GitHub:
github.com/Java-Techie-jt/spr...
Blogs:
/ javatechie
Facebook:
/ javatechie
guys if you like this video please do subscribe now and press the bell icon to not miss any update from Java Techie
Disclaimer/Policy:
--------------------------------
Note : All uploaded content in this channel is mine and its not copied from any community ,
you are free to use source code from above mentioned GitHub account Наука
So helpful, thanx a lot!! I was struggling on method reference for some days before i came across this excellent video - released just in time! 👍😁
Brilliant. Nobody explains like you. Thanks
Awesome Explanation with example....! 😊👌👍
Thanks a lot!!!! Concept was explained in very interesting and detailed way.
Thanks for the simple explanation!
Very Good. You explained a long theory just over 30 minutes in simple terms. Thanks for the video.
Hello from finland. Hei suomesta ja kiitos😍
Nicely explained!
You have skill teaching.
Your videos are great as always. ❤️
Excellent boss, Kudos
Your tutorials are just awesome...
Thankyou for Explanation.
Excellent job 🎉
Thanks a lot for helping here
really its great video
Good explanation..
we want it you got it, Godly content!!
Super expiation
You are really Great and AWESOME….😊
Gurudevobhava 🙏 Excellent explanation!! And specially Employee::getName 🙏 God bless you 🙏
My pleasure buddy that i am able to explain in proper way
@@Javatechie you explain so good because you very good knowledge and skills to explain!!! God bless you 🙌
Great explanation
Hi Basant, eagerly waiting for the video series of Java 17 from you ... thanks in advance
Okay i will upload it
Nice explanation 👍🏻😊
Thanks
Hi Brother, Thanks for this series,
Could you please make a video on Java 8 grouping by.
Thanks in advance!!
Okay
Superb 🌻...also please do a video DTO's in springboot in my project we've using DTO's I am unable to get the use and purpose of implementing DTO's 😭 please do a small video if possible 🧡
Okay 👍
It Awesome!. Can you make one video for MapStruct
Okay sure
In the last minute you are printing the ids from ArrayList but they are empty, why? What to do to show ids?
out::println is instance method reference right correct me if im wrong
Sir can we get the code which u are using to explain ?
is foreach accepts consumer only right? but you are calling static method ref
Bhaiya mzza aagya, are println static nahi hei😂😂😂😂
🤪 static to hai println
What if Instance method has arguments, can we use it with class reference?
Yes we can like String::toUpperCase
@@Javatechie Please give an example for Method reference where the method takes multiple arguments.
Hi bro, Thank you for the video on method reference.
Kindly help me to understand
Reference to an instance method of an arbitrary object of a particular type with below example.
Example:
String [] array = {"Code","Java","C++"};
Arrays.sort ( array, String:: compareToIgnoreCase);
In this example ,String Class compareToIgnoreCase method having arguments then
How ClassName:: instance method working here. Kindly help with this
@javatechie why didn't you answer this question please? I also found it pertinent.
If it takes a single argument of the type which you are getting from the stream then it will work
I think it is taking String as object literal
Hello Sir how this is working Employee::getName , as we know we can't call a non static method using the above syntax. It's bit confusing. Can anyone help me to understand this concept
Please check the video again. I have explained the same question over there
@@Javatechie Ok Sir Thank you so much for providing the good content. Really because of your videos only I am able to start with Spring Boot.
Good to hear this 😃. Keep learning
.min((Integer::compareTo)); but in this example compareto contains method parameter even though how can I access directly without creating object could you explain it
Not getting your question? Where did we create an object?
@@Javatechie Optional maximumNumber = numbers .stream() .filter(Objects::nonNull)// It filter non null elements .max((Integer::compareTo)); // returns maximum number and through exception if the element is null it filters non-null elements Optional minNumber = numbers .stream() .filter(Objects::nonNull)// It filter non null elements .min((Integer::compare));
Compare is a static method we can Directly access by using class name but compareTo method is a non static method but how can we accessed by using class name but it contains also the method parameter you said that we can't able to access that method by using class name by method reference if the method contains method parameter
What are VO and DTO classes
Value object and data transfer object. Both are the same who hold request attribute
Awesome bro, but the source link you posted is not a correct one.
can you please share the source code with us?
Let me check and update
interview question @29:43
Sir there is and arbitorary method refrence . I have seen many place . Please cover that. I realy do not underatand it
Okay but that is kind of predefined method for example String::toUpperCase
Is kafka videos are coming for begineers?
Yes will start from very basic level
@@Javatechie when can i expect please i really want to learn
@@AbhishekGupta-fi2wp next week onwards i will upload
Little bit confusing
What's your confusion
Your native accent is very bad,
Nice tutorial. Please share reason for map(ArrayList::new) in the following line you showed at the very end:
It just prints empty ArrayList as many times as the number of employees. Not sure the intent of printing empty list. Thanks
______
service.loadEmployeesFromDB().stream().map(Employee:getId).map(ArrayList::new).f
orEach(System.out.println);