DEV Community

Discussion on: Java In 2019 And Beyond

Collapse
 
zerh profile image
Eliezer Herrera • Edited

This lines like this...

 ArrayList<Integer> myList = new ArrayList<Integer>(); 

...are not totally true in "old java", the declaration of the generic object should use the generic args, but... not the instantiation. Should be like this:

ArrayList<Integer> myList = new ArrayList<>();