+ 1

what this?

how i can use “::”?

27th Jul 2020, 9:13 PM
Алексей Ложкин
Алексей Ложкин - avatar
4 Antworten
+ 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
27th Jul 2020, 11:57 PM
Jesús Roberto GR 🇲🇽
Jesús Roberto GR 🇲🇽 - avatar
+ 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(); } }
2nd Aug 2020, 3:58 PM
Алексей Ложкин
Алексей Ложкин - avatar
+ 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/
28th Jul 2020, 2:07 AM
navneet
navneet - avatar