2. Preface to the Third Edition

2.1. What’s New in the Third Edition

The third edition has the following substantive changes:

 

Although the book retains its emphasis on a “running example” that is revisited in several chapters, the CyberPet examples have been replaced with a collection of games and puzzle examples. The CyberPet examples from earlier editions will be available on the Companion Web Site.

 

iii

 

Table 1: Table of Contents for the Third Edition.

 

Chapter

Topic

Chapter 0

Chapter 1

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 6

Chapter 7

Chapter 8

Chapter 9

Chapter 10

Chapter 11

Chapter 12

Chapter 13

Chapter 14

Chapter 15

Chapter 16

Computers, Objects, and Java (revised)

Java Program Design and Development Objects: Defining, Creating, and Using

Methods: Communicating with Objects (revised) Input/Output: Designing the User Interface (new) Java Data and Operators

Control Structures

Strings and String Processing Inheritance and Polymorphism (new) Arrays and Array Processing Exceptions: When Things Go Wrong Files and Streams

Recursive Problem Solving Graphical User Interfaces

Threads and Concurrent Programming Sockets and Networking (expanded) Data Structures: Lists, Stacks, and

Queues (revised and expanded)

 

Chapters 0 (Computers, Objects, and Java) and 1 (Java Program De- sign and Development) have been substantially reorganized and rewritten. The new presentation is designed to reduce the pace with which new concepts are introduced. The treatment of object- oriented (OO) and UML concepts has also been simplified, and some of the more challenging OO topics, such as polymorphism, have been moved to a new Chapter 8.

The new Java 1.5 Scanner class is introduced in Chapter 2 and is used to perform simple input operations.

Chapter 4 (Input/Output: Designing the User Interface) has been completely written. Rather than relying primarily on applet inter- faces, as in the second edition, this new chapter provides indepen- dent introductions to both a command-line interface and a graphi- cal user interface (GUI). Instructors can choose the type of interface that best suits their teaching style. The command-line interface is based on the BufferedReader class and is used throughout the rest of the text. The GUI is designed to work with either graphi- cal applications or applets. Both approaches are carefully presented to highlight the fundamentals of user-interface design. The chapter concludes with an optional section that introduces file I/O using the new Scanner class.

Much of the discussion of inheritance and polymorphism, which was previously woven through the first five chapters in the second edition, has been integrated into a new Chapter 8.

An optional graphics track is woven throughout the text. Beginning with simple examples in Chapters 1 and 2, this track also includes

 

some of the examples that were previously presented in Chapter 10 of the second edition.

Chapter 15, on Sockets and Networking, is expanded to cover some of the more advanced Java technologies that have emerged, includ- ing servlets and Java Server Pages.

Chapter 16, on Data Structures, has been refocused on how to use data structures. It makes greater use of Java’s Collection Framework, including the LinkedList and Stack classes and the List inter- face. It has been expanded to cover some advanced data structures, such as sets, maps, and binary search trees.