Chapter 2.  Arrays: Foundational Collections

Quite often, our applications need to store multiple pieces of user data or objects in memory at runtime. One solution is to define multiple fields (properties) in our various classes to store each of our required data points. Unfortunately, even when working with the simplest workflows, this approach quickly becomes ineffective. We will either have too many fields to work with, or we simply won't have any way of anticipating all of the dynamic requirements for our project at compile time.

One solution to this problem is to use an array. Arrays are simple collections of data, and they are one of the most common data structures you will encounter in your day-to-day programming experience due to the fact ...

Get Everyday Data Structures now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.