|
|
|
|
|||
|
The SCJP Handbook |
Sometimes while programming, you need to deal with not just one object but a group of them. For instance, if you have human resource application, you are likely to have the list of employees working. You will probably model the employees as objects. But what about the list of employees? You might need to perform operations on that list such as add a new employee or search for a particular employee. The best way to satisfy all these needs is to represent the employee list as an object itself. For that, you need a class that can store multiple employee objects, retrieve or search the employee etc. However, you need not write one of your own. Java provides you with a few generic classes that can store (, retrieve and manipulate) a group of objects. These classes are popularly known as collections. In this chapter, we will discuss collection classes and their appropriate use. Specifically this chapter covers the entire ninth objective.