|MySQL Conference and Expo April 14-17, 2008, Santa Clara, CA|
Working with Object Trees: Part Oneby Budi Kurniawan
For example, you can create a folder tree like the one in Windows Explorer. In that application, you can navigate through your file directory system and open a directory by clicking the folder icon. Another example is an XML-based online help system or table of contents for your online books.
The array object
Also, as we get deeper into this concept, you'll see that you can create an array with or without specifying the number of elements. If you create an array without specifying the number of elements, the array behaves like a Vector object in Java where you can add elements arbitrarily.
The array object has one drawback: It's very hard to delete an element in an array.
Creating an array
Creating an array is as easy as assigning a variable with
The array element count starts from 0. If you specify an array with 20 elements like above, the array has the element index from 0 to 19.
An array also has the
Listing 1: Creating arrays