• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13. Arrays > Deconstructing an Array

Deconstructing an Array

As stated earlier, an array is a data type that can hold multiple pieces of information. Here's an easy way to imagine this: A variable is like a chair, and it can hold one person (one piece of data). On the other hand, an array is more like a bench, and it can hold multiple people (multiple pieces of data).

Each piece of data in an array is called an element. Each element is automatically assigned the name of the array and a unique number called its index, which is enclosed in brackets. However, the first element in an array is not assigned the number 1; it is instead assigned the number 0 because arrays start counting at zero instead of one.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint