posted 21 years ago
Hi friends,
Where can I find the source code for java.util.ArrayList and java.util.LinkedList ?
Basically I wanted to do a comparision as to why ArrayList is more efficient than LinkedList in case of iteration.
Also why is the Capacity idiom there in ArrayList when it is not required in a LinkedList ?
Except for the method ensureCapacity(), all other imp. methods of ArrayList r there in LinkedList. Both r indexed based datastructures with LinkedList having more functionality than ArrayList. So why should one use an ArrayList at all ? The only explanation is, an ArrayList is more efficient ...
which I am not able to visualize :roll: unless n until I see the source code.