+ 6

What does it mean to reference a method?

Learnt from challenges that to reference a method in java, use "::". My question is why would I ever need to do that?

12th Oct 2017, 10:02 PM
David Akhihiero
David Akhihiero - avatar
1 Réponse
+ 4
sometimes you have to use anonymous methods or lambdas to define a certain method to use. usually these lambdas then call a already defined method which is kind of a overheat. so instead of making a lambda which calls a function you can refer to the function directly by methods refering [https://docs.oracle.com/javase/tutorial/java/javaOO/methodreferences.html]
12th Oct 2017, 10:20 PM
Chrizzhigh
Chrizzhigh - avatar