You learned about the process of creating objects based on class definitions, a process known as instantiation, in Chapter 3. When we're only creating a few objects, we can afford to declare individualized reference variables for these objects: Students s1, s2, s3, perhaps, or Professors profA, profB, profC. But, at other times, individualized reference variables are impractical.
Sometimes, there will be too many objects, as when creating Course objects to represent the hundreds of courses in a university's course catalog.
Worse yet, we may not even know how many objects of a particular type there will be in advance. With our Student Registration System, for example, we may create a new Student object each time a new student logs on for the first time.
Fortunately, OOPLs solve this problem by providing a special category of object called a collection that is used to hold and organize other objects.
In this chapter, you'll learn about
The properties and behaviors of some common collection types
How collections enable us to model very sophisticated real-world concepts or situations
How we can define our own collection types