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.ra...@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.mhasw...@gmail.com>
wrote:

Wouldn't Arrays.asList
<
http://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html#asList-T...-

work for you?



Reply via email to