What are collection objects in VB.net ?
![]() Don't want to miss a single bit? Subscribe By Email for Daily Jobs |
VB.Net implements a special object called Collection object that acts as a container for objects of all types. Collection can hold other objects as well as non object data. A Collection has four methods:
- Add: This method adds a member to collection. Along with data one can also specify a key value by which the data can be referenced.
- Count: This returns the total number of items in the collection object.
- Item: Retrieves an item from the collection. An item can be retrieved either using the index or a key if specified.
- Remove: Removes an item from the collection.
e.g. Dim students As New Collection
students.Add (“john”, “1”); //The second argument is a key to object
students.Add (“paul”, “2”);
Related Articles
- What are the difference between Set and List.in Java ?
- What is the significance of the “finalize” method ?
- What are Vectors in C++(Object Oriented Programming) and how are they used ?
- What are objects ? What is common between all objects of a class ?
- Explain command routing ?


