May 2008
Beginner
550 pages
13h 22m
English
A collection is a set of objects that share the same characteristics. You can have a collection of strings, as you do with the weekDays array, or you can have collections of complex objects, like a listview or similar control object.
Try It Out: Squares and CubesSuppose you wish to iterate through the days and weekDays arrays. Because arrays are objects, you can treat them as a collection. A sample run of a test program is shown in Figure 8-11. Figure 8-11. Figure 8-11
Notice how you can place either collection in the listbox object. How It Works The code for the program is shown in Listing 8-3. Example 8-3. Listing 8-3
The two arrays ... |
Read now
Unlock full access