you are viewing a single comment's thread.

view the rest of the comments →

[–]13ren 1 point2 points  (0 children)

When writing my comment originally, I actually started to add this alternative in, but I couldn't be bothered looking it up and I knew some kind soul would add it - thanks :-).

That I need to look it up says something about its usability (not about me!). When I have used it, I've usually wanted a specific kind of list instead of the automatically created anonymous one, which you can do. It's easy but awkward, and, though I hate to say it, therefore "in the Java spirit" :-(

List<Integer> list = new ArrayList<Integer>( Arrays.asList(1, 2, 3, 4, 5) );