![]() If your program itself is thread-safe and does not share the same set/object among multiple threads, using ArrayList is a better choice. Vector is similar to Array List, but belongs to a strongly synchronized class. If the amount of data and computation is small, the comparison will be meaningless. Of course, these comparisons are made when the amount of index data is large or the operation is frequent. ![]() LinkedList is a double linked list with better performance than ArrayList in adding and deleting elements, but weaker in get and set than ArrayList. Internal elements can be accessed directly through get and set methods, because ArrayList is essentially an array. When more elements are added to the ArrayList, its size will increase dynamically. All the ways of use are similar, the main difference is that because of the different ways of implementation, different operations have different efficiency.ĪrrayList is an array of variable sizes. ![]() Comparison of ArrayList, LinkedList and VectorĪs can be seen from the figure, these three implements the List interface.
0 Comments
Leave a Reply. |