First line question | Sololearn: Learn to code for FREE!

0

First line question

I think it’s should be ArrayList<String> list = new<String> ArrayList; Instead List <String> list = new<String> ArrayList;

6/1/2019 10:21:12 PM

Ivanov Viktor

1 Answer

New Answer

+2

Here is an explanation: https://stackoverflow.com/questions/9852831/polymorphism-why-use-list-list-new-arraylist-instead-of-arraylist-list-n