+ 1
JAVA. On which of this three lines compilation fails?
Please, help! On which line compilation will give an error if at all: ArrayList<Integer> counts = new ArrayList<>(); - Not this one 100% counts.add(10); counts.add(new Integer(8)); Any help is much appreciated!
1 Answer
+ 1
Just put it into code playground and run it:) I already did that for you. If you imported java.util.ArrayList, then it should do fine:
https://code.sololearn.com/c2LV6shnrfg8/?ref=app