posted 7 years ago
Have you read their API documentation or the Java™ Tutorial?
See the RandomAccess interface. Quicker for adding at the end, finding elements in the middle, etc.Sagar Rohankar wrote:ArrayList: When you're iterating over a list of data which required fast or constant time retrieval.
Quicker for adding and removing in the middle or beginning, but slower for finding elements in the middle. Better for Queue use, but see the ArrayDeque class too.LinkedList: When you're a adding, removing and getting data from the list.