VB.NET - Arrays and collections

Define arrays and collections.

Arrays:

- It stores a fixed size sequential collection of elements of the same type.
- It is used to store a collection of data.
- It consists of contiguous memory locations.
- The lowest element corresponds to the first and the highest element to the last.
- It provides best performance for certain requirements.

Example:
1. Dim a() As Integer = {5, 10, 15, 20}   // Initializing array : An array of 5 element
2. String name(5) As String   // An array of 6 strings

Collections:

- A collection can also store group of objects. But unlike an array which is of fixed length, the collection can grow or shrink dynamically.
- Items can be added or removed at run time.
- These are the specialized classes for data storage and retrieval.
- It supports stack, queues, lists and hash tables.

Collection includes various classes are as follows:

ClassDescription
ArrayListIt represents ordered collection of an object that can be indexed individually.
HashtableIt uses a key to access the elements in the collection.
StoredListIt uses a key as well as an index to access the items in a list.
StackIt represents LIFO(Last-In-First-Out) collection of object.
QueueIt represents FIFO(First-In-First-Out) collection of object.
VB.NET - Use properties instead of fields
VB.NET - Use properties instead of fields - You can provide validation code with properties that validate data being read or set......
VB.NET - Define delegate. How to implement it.
VB.NET - Define delegate. How to implement it - A delegate acts like a strongly typed function pointer......
VB.NET - Parse method
VB.NET Parse method - Parse method is used to convert string value to numeric type......
Post your comment