Mega Code Archive

 
Categories / VB.Net / Data Structure
 

A simple class to store in the array

Imports System Public Class MainClass          Shared Sub Main()          Dim intArray As Integer(  )          Dim empArray As Employee(  )          intArray = New Integer(5) {}          empArray = New Employee(3) {}          'populate the array          Dim i As Integer          'for indices 0 through 3          For i = 0 To empArray.Length - 1              empArray(i) = New Employee(i + 5)              i = i + 1          Next     End Sub End Class  Public Class Employee      Private empID As Integer      'constructor      Public Sub New(ByVal empID As Integer)          Me.empID = empID      End Sub  End Class