Guest User

Untitled

a guest
Mar 23rd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. Object of_ref = Stream::of; // compile-time error
  2.  
  3. java.util.function.Function of_ref = Stream::of;
  4. Object obj = of_ref; // compiles ok
  5.  
  6. int x = 5;
  7. FunctionalInterface func = (x) -> System.out.println(x);
  8.  
  9. public abstract void xxx(int value);
  10.  
  11. Function<T, Stream<T>> of_ref = Stream::of;
  12.  
  13. Function<T, Stream<T>> of_ref = new Function<T, Stream<T>>() {
  14. Stream<T> apply(T t) {
  15. return Stream.of(t);
  16. }
  17. };
  18.  
  19. Object of_ref = Stream::of;
  20.  
  21. Object of_ref = new [**What goes here?**]() {
  22. [**What method signature goes here?**] {
  23. return Stream.of(t);
  24. }
  25. };
  26.  
  27. Object of_ref = list -> Stream.of(list);
  28.  
  29. Object obj = (Function<?, ?>) Stream::of;
Add Comment
Please, Sign In to add comment