r/programming • • Feb 22 '15

Java Makes Programmers Want To Do Absolutely Anything Else With Their Time

http://www.forbes.com/sites/quora/2015/02/21/java-makes-programmers-want-to-do-absolutely-anything-else-with-their-time/
35 Upvotes

636 comments sorted by

View all comments

1

u/zehydra Feb 22 '15

"HashMap<String, Set> depMap = new HashMap(); …I die a little on the inside. Because to me, that says, “depMap is a map, which is a map.”"

Sorta. It's setting a reference of type HashMap to a new HashMap.

-6

u/[deleted] Feb 22 '15

new HashMap();

new HashMap <String, Set>();

1

u/Pragmataraxia Feb 22 '15

Some time ago, they allowed the template (or whatever Java calls them) variables to be inferred from the variable declaration, so you no longer have to type that part out.