why needed Generic Class ARRAYLIST while we can make array of wrapper classes and other ?? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

why needed Generic Class ARRAYLIST while we can make array of wrapper classes and other ??

27th Aug 2017, 3:22 AM
Shaan Ali
Shaan Ali - avatar
2 Réponses
+ 4
An ArrayList is mutable and an array is not. You can not change the length of an array without creating a new one in memory. This means that you can't delete/add an element from/to an array without creating a new array. This means that an ArrayList is more dynamic.
27th Aug 2017, 3:46 AM
ChaoticDawg
ChaoticDawg - avatar
0
Thnkss a lot
27th Aug 2017, 6:33 AM
Shaan Ali
Shaan Ali - avatar