Question: Why cant we create generic array, or write code as List[] array = new ArrayList[10];?

Why can’t we create generic array, or write code as List[] array = new ArrayList[10];?

Step by Step Solution

3.52 Rating (145 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

In Java arrays are what we call reified types This means that they have runtime type information abo... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Advanced Java Programming Questions!