title: How to create an array of objects Visual Basic
body: <p>Is it possible to create an array of objects in visual basic?</p>
  
  <p>I'm making a battle system and whenever the battle begins, i wanna be able to randomly select a Monster object from an array.</p>
  
  <p>If it is possible, could somebody show me how to store <code>Public Spider as New Monster(50, 20, 5)</code> into an array?</p>
  
  <p>Thank you.</p>
  
  <p><strong>Monster Class:</strong></p>
  
  <pre><code>Public Class Monster
  
    Private hp As Integer
    Private xp As Integer
    Private dmg As Integer
  
    Sub New(ByVal hitpoints As Integer, ByVal exp As Integer, ByVal damage As Integer)
      hp = hitpoints
      xp = exp
      dmg = damage
    End Sub
  
  End Class
  </code></pre>
  
  <p><strong>Form Class:</strong></p>
  
  <pre><code>Imports Monster
  Public Class Form
  
    Public Spider As New Monster(50, 20, 5)
  
  End Class
  </code></pre>