Is there any reason to do this:
List<Integer> integers = new ArrayList<Integer>();
versus this:
List<Integer> integers = new ArrayList<>();
I've seen the first usage a few times, and it seems to provide no benefit, which begs the question: why use it?
I understand that the diamond operator (<>) is necessary to differentiate between new LinkedList()
and new LinkedList<>()
, just to be clear.