iii
PREFACE
Dear Reader,
Many of you have provided feedback on earlier editions of this book, and your comments and
suggestions have greatly improved the book. This edition has been substantially enhanced in
presentation, organization, examples, exercises, and supplements. The new edition:
■ Replaces Swing with JavaFX. JavaFX is a new framework for developing Java GUI pro-
grams. JavaFX greatly simplifies GUI programming and is easier to learn than Swing.
■ Introduces exception handling, abstract classes, and interfaces before GUI programming to
enable the GUI chapters to be skipped completely if the instructor chooses not to cover GUI.
■ Covers introductions to objects and strings earlier in Chapter 4 to enable students to use
objects and strings to develop interesting programs early.
■ Includes many new interesting examples and exercises to stimulate student interests. More
than 100 additional programming exercises are provided to instructors only on the Com-
panion Website.
Please visit
www.pearsonhighered.com/liang for a complete list of new features as well as
correlations to the previous edition.
The book is fundamentals first by introducing basic programming concepts and techniques
before designing custom classes. The fundamental concepts and techniques of selection
statements, loops, methods, and arrays are the foundation for programming. Building this
strong foundation prepares students to learn object-oriented programming and advanced Java
programming.
This book teaches programming in a problem-driven way that focuses on problem solv-
ing rather than syntax. We make introductory programming interesting by using thought-
provoking problems in a broad context. The central thread of early chapters is on problem
solving. Appropriate syntax and library are introduced to enable readers to write programs for
solving the problems. To support the teaching of programming in a problem-driven way, the
book provides a wide variety of problems at various levels of difficulty to motivate students.
To appeal to students in all majors, the problems cover many application areas, including
math, science, business, financial, gaming, animation, and multimedia.
The book seamlessly integrates programming, data structures, and algorithms into one text.
It employs a practical approach to teach data structures. We first introduce how to use various
data structures to develop efficient algorithms, and then show how to implement these data
structures. Through implementation, students gain a deep understanding on the efficiency of
data structures and on how and when to use certain data structures. Finally we design and
implement custom data structures for trees and graphs.
The book is widely used in the introductory programming, data structures, and algorithms
courses in the universities around the world. This comprehensive version covers fundamentals
of programming, object-oriented programming, GUI programming, data structures, algorithms,
concurrency, networking, database, and Web programming. It is designed to prepare students
to become proficient Java programmers. A brief version (Introduction to Java Programming,
Brief Version, Tenth Edition) is available for a first course on programming, commonly known
as CS1. The brief version contains the first 18 chapters of the comprehensive version. The first
13 chapters are appropriate for preparing the AP Computer Science exam.
The best way to teach programming is by example, and the only way to learn program-
ming is by doing. Basic concepts are explained by example and a large number of exercises
what is new?
fundamentals-first
problem-driven
comprehensive version
brief version
AP Computer Science
examples and exercises
data structures