Murach's Beginning Java 2, JDK 5
How to work with collections and generics

Once you know how to use arrays, this chapter shows you how to use collections, which are similar to arrays but provide more advanced features. Along with collections, you'll learn how to use generics, a new feature of Java 5.0 that lets you specify the type of objects that can be stored in a collection.

Chapter 11 How to work with collections and generics
An introduction to Java collections 346
A comparison of arrays and collections 346
An overview of the Java collection framework 348
Commonly used collection classes 348
An introduction to generics 350
How to use the ArrayList class 352
The ArrayList class 352
Code examples that work with array lists 354
An Invoice application that uses an array list 356
An overview of the Invoice application 356
The code for the Invoice class 358
The code for the InvoiceApp class 360
How to use the LinkedList class 362

The LinkedList class

362
Code examples that work with linked lists 364
A class that uses a linked list to implement a generic queue 366
An enhanced version of the Invoice application 368
An overview of the enhanced Invoice application 368
The code for the InvoiceApp class 370
How to work with maps 374
The HashMap and TreeMap classes 374
Code examples that work with hash maps and tree maps 376
How to work with legacy collections 378
An introduction to legacy collection classes 378
How to use an untyped collection 380
How to use wrapper classes with untyped collections 382




Murach's Beginning Java 2

Learn more about this book

Add this book to your cart



Our Ironclad Guarantee

First, try our books for 90 days. Then, if you aren't completely convinced that our books are the best ones you've ever used, you can return them for a full refund...no questions asked.