ArrayList stores homogeneous(mean same type like int or float or char etc) data as well as hetrogeneous(different type of data like int, string char all together) data. This is because of the interaction problem of arrays with the Generics Arrays are covariant in nature while Generics is invariant. Array stores homogeneous(mean same type like int or float or char etc) data.ĪrrayList is similar to variable only thing is that it can hold more than one value at time. One more major difference between arrays and ArrayList is that ArrayList supports the generics in Java but arrays do not support generics. from ArrayList are dependably references to objects at various memory areas. ![]() ![]() The most important difference between Array and ArrayList is given below ParameterĪrray is similar to variable only thing is that it can hold more than one value at time. Array vs ArrayList in Java: introduction to Java Array and Arraylist Java.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |