+ 1
what this?
how i can use “::”?
3 Respostas
+ 3
Since Java 8, you can use lambda expression for one method reference... Here you have some details:
https://www.javatpoint.com/java-8-method-reference
https://www.codementor.io/@eh3rrera/using-java-8-method-reference-du10866vx
+ 2
Like this. When a thread starts, its Runnable is called and super :: speak is executed by calling the speak of the superclass. (Note that in the inner class, you can grab this reference from the application class like EnclosingClass.this :: method or EnclosingClass.super :: method.)
class Speaker {
public void speak() {
System.out.println("Hello, world!");
}
}
class ConcurrentSpeaker extends Speaker {
public void speak() {
Thread t = new Thread(super::speak);
t.start();
}
}
+ 1
Search for the same on google, you can quickly do that and it would be easy...by the way I have included link for that below ↓
https://www.geeksforgeeks.org/double-colon-operator-in-java/amp/