Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,895 questions

51,826 answers

573 users

How to create, initialize and print array in VB.NET

4 Answers

0 votes
Imports System

Public Class Test
    Public Shared Sub Main()
        Dim array() As String = {"vb.net", "c#", "php", "c"}

        For Each item As String In array
            Console.WriteLine(item)
        Next
    End Sub
End Class



' run:
'
' vb.net
' c#
' php
' c

 



answered Apr 17, 2019 by avibootz
edited Jul 20, 2019 by avibootz
0 votes
Imports System

Public Class Test
    Public Shared Sub Main()
        Dim array() As Integer = {3, 6, 4, 8, 1, 0}

        For Each item As Integer In array
            Console.WriteLine(item)
        Next
    End Sub
End Class



' run:
'
' 3
' 6
' 4
' 8
' 1
' 0

 



answered Apr 17, 2019 by avibootz
edited Jul 20, 2019 by avibootz
0 votes
Imports System

Public Class Test
    Public Shared Sub Main()
        Dim array(3) As Integer

        array(0) = 23
        array(1) = 91
        array(2) = 75
        array(3) = 18

        For Each item As Integer In array
            Console.WriteLine(item)
        Next
    End Sub
End Class



' run:
'
' 23
' 91
' 75
' 18

 



answered Apr 17, 2019 by avibootz
edited Jul 20, 2019 by avibootz
0 votes
Imports System

Public Class Test
    Public Shared Sub Main()
        Dim array(3) As String

        array(0) = "VB.NET"
        array(1) = "C#"
        array(2) = "PHP"
        array(3) = "C"

        For i As Integer = 0 To array.Length - 1
            Console.WriteLine(array(i))
        Next
    End Sub
End Class



' run:
'
' VB.NET
' C#
' PHP
' C

 



answered Apr 17, 2019 by avibootz
edited Jul 20, 2019 by avibootz

Related questions

...