- VB.Net - Event Handling
- VB.Net - Advanced Forms
- VB.Net - Dialog Boxes
- VB.Net - Basic Controls
- VB.Net - File Handling
- VB.Net - Exception Handling
- VB.Net - Classes & Objects
- VB.Net - Subs
- VB.Net - Functions
- VB.Net - Collections
- VB.Net - Arrays
- VB.Net - Date & Time
- VB.Net - Strings
- VB.Net - Loops
- VB.Net - Decision Making
- VB.Net - Operators
- VB.Net - Directives
- VB.Net - Statements
- VB.Net - Modifiers
- VB.Net - Constants
- VB.Net - Variables
- VB.Net - Data Types
- VB.Net - Basic Syntax
- VB.Net - Program Structure
- VB.Net - Environment Setup
- VB.Net - Overview
- VB.Net - Home
VB.Net Advanced Tutorial
- VB.Net - Web Programming
- VB.Net - XML Processing
- VB.Net - Send Email
- VB.Net - Excel Sheet
- VB.Net - Database Access
- VB.Net - Regular Expressions
VB.Net Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
VB.Net - Collections
Collection classes are speciapzed classes for data storage and retrieval. These classes provide support for stacks, queues, psts, and hash tables. Most collection classes implement the same interfaces.
Collection classes serve various purposes, such as allocating memory dynamically to elements and accessing a pst of items on the basis of an index, etc. These classes create collections of objects of the Object class, which is the base class for all data types in VB.Net.
Various Collection Classes and Their Usage
The following are the various commonly used classes of the System.Collection namespace. Cpck the following pnks to check their details.
Class | Description and Useage |
---|---|
It represents ordered collection of an object that can be indexed inspanidually. It is basically an alternative to an array. However, unpke array, you can add and remove items from a pst at a specified position using an index and the array resizes itself automatically. It also allows dynamic memory allocation, add, search and sort items in the pst. |
|
It uses a key to access the elements in the collection. A hash table is used when you need to access elements by using key, and you can identify a useful key value. Each item in the hash table has a key/value pair. The key is used to access the items in the collection. |
|
It uses a key as well as an index to access the items in a pst. A sorted pst is a combination of an array and a hash table. It contains a pst of items that can be accessed using a key or an index. If you access items using an index, it is an ArrayList, and if you access items using a key, it is a Hashtable. The collection of items is always sorted by the key value. |
|
It represents a last-in, first out collection of object. It is used when you need a last-in, first-out access of items. When you add an item in the pst, it is called pushing the item, and when you remove it, it is called popping the item. |
|
It represents a first-in, first out collection of object. It is used when you need a first-in, first-out access of items. When you add an item in the pst, it is called enqueue, and when you remove an item, it is called deque. |
|
It represents an array of the binary representation using the values 1 and 0. It is used when you need to store the bits but do not know the number of bits in advance. You can access items from the BitArray collection by using an integer index, which starts from zero. |