Quick access. Search related threads. Remove From My Forums. Answered by:. Archived Forums. Getting Started with ASP. NET question on a topic that's not covered by one of the other more specific forums - ask it here. Ask a Question. Which is better? Please Sign up or sign in to vote. See more: C. I require a fast speed in processing my page.
Which one of the above is preferred? Support with a valid reason. Copy Code. Posted May am Member Add a Solution. Member May am. Top Rated Most Recent. Accept Solution Reject Solution. The capacity of an Array is fixed.
Where as, ArrayList can increase and decrease size dynamically. An Array is a collection of similar items. Where as, ArrayList can hold item of different types. Array is in the System namespace. Where as, ArrayList is in the System. Collections namespace. An Array can have multiple dimensions.
Where as, ArrayList always has exactly one dimension. The List is a child interface of the Collection framework that allows us to maintain the ordered collection of the objects.
We can store the duplicate values and null elements using List. It provides an index-based method to perform the insert, delete, search, update operations on the objects.
The List interface takes place in java. It is also a base of ListIterator classes using which we can iterate the List in forward and backward directions. List interface provides positional access and insertion of elements and preserves the insertion order. The instance of the List can be created using the implementing classes. ArrayList class uses a dynamic array for storing the elements.
The ArrayList class acts like an array, but there is no size limit in it. We can add or remove the elements whenever we want. We can store the duplicate element using the ArrayList class. It manages the order of insertion internally. The ArrayList class is much more flexible than the traditional array. It implements the List interface to use all the methods of List Interface.
It takes place in Java. The elements of it can be randomly accessed. It can not be used for primitive types such as int, char, etc. Save Article. Improve Article. Like Article. Next Array vs ArrayList in Java. Recommended Articles. Article Contributed By :. Easy Normal Medium Hard Expert.
0コメント