0

Hi,

How can I create an array of a class that I have declared?

I have this class named parts
with properties of frame, engine and date, and i want to know how could I store them in an array ..

thanks

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Reverend Jim
0

dim myarray(20) as parts

This will create an array where each item can contain a reference to a part, however, the objects themselves do not exist until they are instantiated (with New). In order to actually create an array of part objects you have to do

for i as integer = 0 to 20
    myarray(i) = New parts
next
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.