Last post Jul 02, 2011 01:32 PM by Muhammad Nauman
Jul 01, 2011 01:31 PM|Muhammad Nauman|LINK
1. How many elements an array list can store in VB.NET?
2. Upon what factors the stroing capacity of arraylist depends?
3. What could be the maximum size of an induvidual item in a array list if the item is string type?
Anybody please inform.
Jul 01, 2011 01:57 PM|princeG|LINK
In dot net 1 : The default capacity is 16. and 4.0 Capacity is always greater than or equal to Count|
Capacity is always greater than or equal to Count. If Count exceeds Capacity while
adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements.
The capacity can be decreased by calling TrimToSize or by setting the Capacity property explicitly.
When the value ofCapacity is set explicitly, the internal array is also reallocated to accommodate the specified capacity.
Retrieving the value of this property is an O(1) operation; setting the property is an O(n) operation, where n is the new capacity.
check it and find all the queries:
Jul 01, 2011 05:15 PM|Muhammad Nauman|LINK
"In dot net 1 : The default capacity is 16. and 4.0 Capacity is always greater than or equal to Count|"
What is meant by 16? 16 elements or bytes or KB or MB. Please tell. Isn't it matter of cacapcity of RAM?
Jul 02, 2011 01:14 PM|Andrew Morton|LINK
The ArrayList has been superseded by List(Of T). I would hazard a guess that the maximum number of elements is 2^31-1. The total size, and the size of inidividual elements, will be limited by the amount of memory available to your program, below 2GB on a
32-bit OS, and likely limited to the swap space available on your disk drive for a 64-bit OS.
Jul 02, 2011 01:32 PM|Muhammad Nauman|LINK
Thanks Andrew for such a concrete information.