Collections
Collections
time.
ArrayList:
Capacity is used to give the number of items that can be stored on the given
items and it can be extended. By Default 4 items can be stored in any capacity if
you dont specify the capacity and it will double the size if you add 5 th item i.e. 8
and if you add 9th item then it will be 16 etc.. You can also trim the size of items
to specific number using TrimToSize() method.
Count is used to give the number of items that are there in the current arraylist.
The difference between Add and Insert in Arraylist is...in Add method we will
directly give the name of the item whereas in Insert we need to specify the index
and name to where we are expecting to insert.
HashTable:
From HashTable we get DictionaryEntry from where we can get Key and Value to
iterate through all the items.
The order that we entered into the Hashtable may not return in the same order
when we interate through this collection. Because does not manage the items
through its index position and it uses its own algorithm.
There can be two same values with two different keys in HashTable.