Idea to Java ArrayLists

Daniel Fuchs daniel.fuchs at oracle.com
Thu Jul 9 17:52:51 UTC 2015


Or Stream.of("1", "2", "3").collect(Collectors.toList()); :-)

-- daniel

On 09/07/15 19:46, Louis Wasserman wrote:
> Pavel, what you can do there is new ArrayList<>(Arrays.asList("1", "2",
> "3", "4", "5"));
>
> On Thu, Jul 9, 2015 at 10:40 AM Pavel Rappo <pavel.rappo at oracle.com> wrote:
>
>> Not quite. You don't have the ability to specify a particular
>> implementation
>> (e.g. the thing won't work if what you want is, say, LinkedList)
>>
>>> On 9 Jul 2015, at 18:34, kedar mhaswade <kedar.mhaswade at gmail.com>
>> wrote:
>>>
>>> Wouldn't Arrays.asList
>>> <
>> http://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html#asList-T...-
>>>
>>> work for you?
>>
>>




More information about the core-libs-dev mailing list