Jul 06 2007
Neal Gafter’s proposal for constructor type inference
Neal gafter has proposed that java language include Constructor Type Inference in order to reduce verbosity. So what was
Map<String,List<Thing>> map = new HashMap<String,List<Thing>>();
looks like:
Map<String,List<Thing>> map = new HashMap<>();
Though there is an alternate proposal to deduce the LHS type instead, like:
map := new HashMap<String,List<Thing>>();
I find Neal’s proposal more appealing and more natural to java. It feels so Java, that I have already used it thrice since morning only to be surprised by IDEA’s warnings! So, if anyone is counting votes, +1 from me.
Neal Gafter
July 6th, 2007
5:21 pm GMT-0700
Comment #1