hg: lambda/lambda/jdk: 8023997: j.l.String.join(java.lang.CharSequence, java.lang.Iterable) sample doesn't compile and is incorrect
Kasper Nielsen
kasperni at gmail.com
Tue Sep 3 07:28:25 PDT 2013
On Fri, Aug 30, 2013 at 11:01 AM, Paul Sandoz <paul.sandoz at oracle.com>wrote:
>
> > Is actually "short" for String.join(", ", numbers);
> >
>
> Not quite; List<Integer> is not compatible with Iterable<? extends
> CharSequence>.
>
> You're right,
any reason for not just taking Iterable<?> instead of Iterable<? extends
CharSequence>. As in
public static String join(CharSequence delimiter, Iterable<?> elements) ...
calls .toString() on each element.
- Kasper
More information about the lambda-dev
mailing list