0

Can someone please help me to understand how the lambda expression () -> it; in the following example is interpreted differently?

private static <T> Iterable<T> iterableOf(final Iterator<T> it) {

    final Supplier<Iterator<T>> supplierOfIterator = () -> it;
    final          Iterable<T>  iterable           = () -> it;

    return                      iterable;
}
Dave The Dane
  • 650
  • 1
  • 7
  • 18

0 Answers0