How ite iterates through a collection

xiaoxiao2021-03-06  69

How ite iterates through the collection this topic explains how to create and use

ArrayList. The important part of this discussion is how to use Foreach (VB in the for EACH) command by list.

ArrayList is

Members of the Collection namespace accept any type of object as its element. This topic also tells

The method and attribute of the ArrayList object.

VB List.aspx

[

Run example] | [[[[

View Source Code]

The collection is very similar to the array. In general, the collection can be seen as a special array, with more methods and attributes to help you solve the problem. In this presentation, a specific collection arraylist will be used.

ArrayList accepts a variety of objects, but when used with a collection, try only one data type is useful. The first sample code you will view is a list of creation. This is a simple, only one code, in which you use the ArrayList's constructor to generate a new instance of the collection. Unlike arrays, there is no need to understand the list will accept several elements: ArrayList can determine several elements as you add elements to it.