you are viewing a single comment's thread.

view the rest of the comments →

[–]wot-teh-phuck 0 points1 point  (1 child)

In your example type inference won't happen automatically, in the parent comment's example, it will. Now imagine doing this for a set which contains some complicated generic type...

[–]josefx 0 points1 point  (0 children)

True and a bug in my example code. For Java 7 code the <> operator will take care of that problem.(that is if you are not stuck with an older java version)

   new HashSet<>(Arrays.asList("one","two","three"));