Presumably you could use new ArrayList<>() in contexts where there is no
variable, so shortening:

doSomethingWith(new ArrayList<ICantBelieveItsNotButter>()); to:

doSomethingWith(new ArrayList<>());

On Wed, Sep 22, 2010 at 4:21 PM, Serge Boulay <[email protected]>wrote:

> Is there some particular reason Oracle choose the diamond operator over
> something like “var” ?
>
>
>
> For example, I find this
>
>
>
> List<Employee> emps = new ArrayList<>();
>
>
>
> far less intuitive than say
>
>
>
> var emps = new ArrayList<Employee>();
>
>
>
>
>
> The second example has the added benefit that it would work with all types.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "The Java Posse" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<javaposse%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/javaposse?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to