can collection object holds another arrar
hi
can a object in a collection can store a another collection object ie: arraylist, each object in collection store data of seperate array list
Dim col(5) As Collection
Dim arr as new ArrayList()
form Load event
Dim test As New ArrayList()
'adding 5 object as in "col" collection
test.Add(100)
Dim i As Integer
For i = 1 To 5
col.Add(CType(test, ArrayList), CStr(i))
Next
ButtonClick Event
Dim Temp As New ArrayList()
Dim Index As Integer
Index = Val(TextBox1.Text)
' Assigning to particular object in collection into temp arraylist to add new value
Temp = col.Item(CStr(Index))
Temp.Add(Val(TextBox2.Text))
'remove the particular object from col(collection) which does not contain added value
col.Remove(CStr(Index))
adding new temp arraylist as object in "col"(collection)
col.Add(Temp, CStr(Index))
but the added value is added in all "col" (collection) object
can collcetion object hold other collection
Luv
PurpleHaze
|