Witscale Test Center

The Collection framework


The Collection framework

 

Text Box: 14
The Collection Framework


This chapter covers…

Ñ	Overview of  Collection Framework
Ñ	The equals() & hashCode() methods 
Ñ	Where these methods are defined?
Ñ	Why to override them?
Ñ	How to appropriately override them?

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.