1.5 Collections
Returning to the book analogy we started when discussing libraries, imagine that you own the seven volumes in the Chronicles of Narnia series by C. S. Lewis.
- The Lion, the Witch and the Wardrobe
- Prince Caspian: The Return to Narnia
- The Voyage of the Dawn Treader
- The Silver Chair
- The Horse and His Boy
- The Magician’s Nephew
- The Last Battle
The order I listed them is the order in which Lewis published the volumes from 1950 through 1956. In the list, the first book is the first published, the second is the second published, and so on. Had someone been maintaining the list in the 1950s, they would have appended a new title when Lewis released a new book in the series.
A programming language needs a structure like this so that you can store and insert objects as above. It...