Home > DeveloperSection > Forums > How to use Arrays in vb.net
aditya kumar Patel

Total Post:250

Points:1782
Posted on    December-23-2015 9:30 PM

 VB.Net VB.Net 
Ratings:


 1 Reply(s)
 273  View(s)
Rate this:
I want  to use  Arrays in vb.net please help me.


aditya kumar Patel

Total Post:250

Points:1782
Posted on    December-23-2015 9:31 PM

An array stores a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.

All arrays consist of contiguous memory locations. The lowest address corresponds to the first element and the highest address to the last element.

Module Module1
    Sub Main()
        Dim num(10) As Integer
        Dim i, o As Integer

        For i = 0 To 10
            num(i) = i + 100
        Next i

        For o = 0 To 10
            Console.WriteLine("index ({0}) = {1}", o, num(o))
        Next o
        Console.ReadKey()
    End Sub
End Module


Don't want to miss updates? Please click the below button!

Follow MindStick