Created
April 29, 2022 12:11
-
-
Save mafulafunk/de23a9822a2ed059573abf28a80c5905 to your computer and use it in GitHub Desktop.
KoffeeKlub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ch_015; | |
import java.time.LocalDate; | |
import java.util.function.Function; | |
import java.util.function.Supplier; | |
public class SuppliFication { | |
public static void main(String[] args) { | |
Function<MySupplier, String> foo = MySupplier::get; | |
System.out.println(foo.get()); | |
} | |
} | |
class GoImpl implements GoSupplieIt<String>{ | |
@Override | |
public String goGetIt() { | |
return "null; " + LocalDate.now(); | |
} | |
} | |
@FunctionalInterface | |
interface GoSupplieIt<T> { | |
T goGetIt(); | |
} | |
class MySupplier implements Supplier<String>{ | |
@Override | |
public String get() { | |
return "My DateNow : " + LocalDate.now(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment