ArraList enables the use of generic and single dimensional in nature.ArrayList requires more memory to store the elements as well as more time to iterate.Also, it is dynamic, which means one can change the size of the arraylist if the elements are modified in it, which means the length of the arraylist is variable. ArrayList uses the size() method to compute the size of the elements.Functions such as indexOf() and remove() are not supported by Arrays in Java.In the array, giving references to objects or elements depends upon the type of array such as primitive type or object type.Array does not allow generics, though multidimensional in nature.In other words, the length of the elements in the array is static or requires more memory to store the elements and less time to iterate the elements.This Array needs to specify the size of the elements. ![]() ![]()
0 Comments
Leave a Reply. |