Main Page

Previous Next

Chapter 13: Collection Classes

Overview

In this chapter we'll look at the collection classes that are defined in the java.util package. These provide you with a variety of ways for structuring and managing collections of objects in your programs. In particular the collection classes enable you to deal with situations where you don't know in advance how many objects you'll need to store, or where you need a bit more flexibility in the way in which you access an object from a collection than the indexing mechanism provided by an array.

In this chapter you will learn:

  • What sets, lists, and maps are, and how they work

  • What an Iterator object is used for

  • Which container classes are available

  • What a Vector is and how to use Vector objects in your programs

  • How to manage Vector objects so that storing and retrieving elements is type safe

  • What a Stack is and how you use it

  • What LinkedLists are and how you use them

  • How you store and retrieve objects in a hash table represented by a HashMap object

  • How you can generate hash codes for your own class objects

Previous Next
JavaScript Editor Java Tutorials Free JavaScript Editor