Why explicit type argument should be replaced by diamond? [duplicate] Why explicit type argument should be replaced by diamond? [duplicate] java java

Why explicit type argument should be replaced by diamond? [duplicate]


It is less verbose, consider the following

Map<String,List<String>> map = new HashMap<String,List<String>>();

vs

Map<String,List<String>> map = new HashMap<>();

I think you would go for the second option