What's the difference? I am used to using the LinkedList type, but AP CS extensively uses ArrayList.
Printable View
What's the difference? I am used to using the LinkedList type, but AP CS extensively uses ArrayList.
They are both lists but optimized for different situations. LinkedList is optimized for getting information sequentially while an ArrayList is better at getting information by index (anyone -- please correct if wrong).
Please look here: http://onjava.com/pub/a/onjava/2001/...imization.html
The differences are also described in the API docs: ArrayList and LinkedList