Reputation: 81
I am having problem to start the fold () function related to Java. Can you please help me to know how the structure of the fold function works. I am trying to use this method relating to generics of Java.
Upvotes: 0
Views: 90
Reputation: 200236
By "fold" you probably mean "fold left", which is another name for "reduce". The Java Stream interface defines reduce
, so I suggest inspecting that signature:
T reduce(T identity, BinaryOperator<T> accumulator)
Upvotes: 1