Do something like the Google Collections Library does:
HashMap<String, Integer> foo = Maps.newHashMap();
The return type of newHashMap is determined by the type of foo, so you don't need to repeat the generic types in angle brackets. public static <K, V> HashMap<K, V> newHashMap() {
return new HashMap<K, V>();
}
http://google-collections.googlecode.com/svn/trunk/javadoc/i...(I'm not a fan of Java myself, but there are some tricky ways to cut down on its verbosity)