Zhong Yu zhong.j.yu at
Wed Jun 12 22:33:25 PDT 2013

On Thu, May 30, 2013 at 3:14 AM, Stephen Colebourne
<scolebourne at> wrote:
> On 30 May 2013 08:30, Peter Levart <peter.levart at> wrote:
>> String[] y = x.toArray(String[]::new);
> Thats very nice ;-)
> Stephen

    toArray(new String[0])
not too much difference in syntax. Try to explain it to a newbie:)

I wish we could have something like this:

   interface Collection<E>
        E[] array(E... array);

    Collection<String> x = ...;

This works because an empty String[] is passed in as the arg.

Zhong Yu

More information about the lambda-dev mailing list