Does array creation happen at compilation time?
List<String>[] strings = new List[9];
It works even if List is only an interface, so I guess the array creation happens before type erasue. That's why the following does not work:
List<String>[] strings = new List<String>[9];
Is it due to the fact that the creation of the array itself takes place prior to type erasure right?
Listobjects.new List<String>[9]wont work because that is type unsafe since you wont createnew List<String>[9]but (because of type erasure)new List[9]so you will be able to add to it evenArrayList<Integer>as mentioned in link I gave earlier. So no, creating array at compilation time is not responsible for that behaviour - and is not possible in Java.