As of Java 8, we don't need to specify the types when we pass in typed parameters.
public static void main(String... args) {
operateOnHashMap(new HashMap<>()); // empty diamonds :D
}
static void operateOnHashMap(Map<String, Integer> map) {
// do stuff with map
}
No comments:
Post a Comment