1.

Difference between ArrayList and LinkedList.

Answer»
ArrayListLinkedList
The elements of this class are STORED in a dynamic array. This class now supports the storage of all types of objects thanks to the addition of generics.The elements of this class are stored in a doubly-linked list. This class, like the ArrayList, allows for the storage of any type of object.
The List interface is implemented by this class. As a result, this SERVES as a list.The List and Deque interfaces are both implemented by this class. As a result, it can be used as both a list and a deque.
Because of the internal implementation, manipulating an ArrayList takes LONGER. Internally, the array is scanned and the memory bits are shifted whenever we remove an element.Because there is no concept of changing memory bits in a doubly-linked list, manipulating it takes less time than manipulating an ArrayList. The reference link is changed after traversing the list.
This class is more useful when the application requires DATA storage and access.This class is more useful when the application requires data manipulation.


Discussion

No Comment Found