[Solved] Which Lists will/won’t compile?


The first one is a valid array declaration.
The second one has an incorrect reference type.
In the third one, you cannot create an object of type List as it is an interface
For the last one, it’s ArrayList, not Arraylist.

List[] myList2 = new List[5];
List myList5 = new ArrayList();

solved Which Lists will/won’t compile?