Proposal: Type inference for variable definition/initialization using the 'auto' keyword.
alexandre.makarenko at free.fr
alexandre.makarenko at free.fr
Tue Apr 7 11:57:15 PDT 2009
exactly ;-)
----- Original Message -----
From: "Mark Thornton" <mthornton at optrak.co.uk>
To: "alex" <alexandre.makarenko at free.fr>
Cc: "Tim Lebedkov" <tim.lebedkov at googlemail.com>, coin-dev at openjdk.java.net
Sent: Monday, April 6, 2009 11:31:32 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: Re: Proposal: Type inference for variable definition/initialization using the 'auto' keyword.
alex wrote:
> Hi Tim,
> a little bit late comment...
>
> what if
>
> Map<String, List<String>> anagrams();
>
> compiled as
>
> Map<String, List<String>> anagrams = new HashMap<String, List<String>>();
>
>
Why HashMap and not some other implementation of Map? That approach only
works if the LHS specifies a concrete type and not an interface or
abstract class.
Mark Thornton
More information about the coin-dev
mailing list