156k views
0 votes
Look at program Java1201.java. What piece of information is not necessary to create an ArrayList object that was necessary to create a Java static array?Choose matching definitiona) Arrays are supposed to store elements of the same type, in Java1212 the array is storing an Integer, a Double and a String.b) The number of elements in the arrayc) The index of the item to be removed.d) Generics

User Ralight
by
7.1k points

1 Answer

4 votes

b) The number of elements in the array.

When creating a static array in Java, the number of elements in the array must be specified when the array is declared. This is not necessary when creating an ArrayList object, as an ArrayList is dynamically sized and can grow or shrink as elements are added or removed. The ArrayList automatically resizes to accommodate the new elements.

User Dann
by
6.9k points