3 ms·
I don't think you have to type it twice even now, if you specify the type on the left, you can just specify <> on the right. So you can write something like - M
by whitenoice 11y ago
I don't think you have to type it twice even now, if you specify the type on the left, you can just specify <> on the right. So you can write something like - Map<String, List<Xyz>> foo = new TreeMap<>(); This has been present from Java 7. The reason I like this is that when you are parsing through some library code you can just look at the variable declaration and ignore its initialization to figure out what type it is.