+ 1

Why is only B) Correct?

A) List<Integer> list = new List<Integer>(); B) List<Integer> list = new ArrayList<Integer>(); This is from a challenge question.

6th Aug 2019, 12:27 PM
Samuel
Samuel - avatar
2 odpowiedzi
+ 7
Because List is an abstract class and therefore can't be instantiated?
6th Aug 2019, 12:36 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
0
Is there a typo here? Must be: ArrayList<Integer> list = new ArrayList<Integer>();
6th Aug 2019, 1:11 PM
Solo
Solo - avatar