Table of Contents

1.1 Computer Programs
1.2 The Anatomy of a Computer
1.3 Computing and Society: Computers Are Everywhere
1.4 The Java Programming Language
1.5 Becoming Familiar with Your Programming Environment
1.6 Analyzing Your First Program
1.7 Errors
1.8 Problem Solving: Algorithm Design
1.9 How To: Describing an Algorithm with Pseudocode
1.10 Worked Example: Writing an Algorithm for Tiling a Floor
1.11 Chapter Summary
1.12 Review Exercises
1.13 Practice Exercises
1.14 Programming Projects

2.1 Variables
2.2 Special Topic: Numeric Types in Java
2.3 Special Topic: Big Numbers
2.4 Arithmetic
2.5 Special Topic: Avoiding Negative Remainders
2.6 Special Topic: Combining Assignment and Arithmetic
2.7 Computing and Society: The Pentium Floating-Point Bug
2.8 Input and Output
2.9 How To: Carrying out Computations
2.10 Worked Example: Computing the Cost of Stamps
2.11 Problem Solving: First Do It By Hand
2.12 Worked Example: Computing Travel Time
2.13 Strings
2.14 Special Topic: Instance Methods and Static Methods
2.15 Special Topic: Using Dialog Boxes for Input and Output
2.16 Computing and Society: International Alphabets and Unicode
2.17 Chapter Summary
2.18 Review Exercises
2.19 Practice Exercises
2.20 Programming Projects

3.1 The if Statement
3.2 Special Topic: The Conditional Operator
3.3 Comparing Numbers and Strings
3.4 Special Topic: Lexicographic Ordering of Strings
3.5 How To: Implementing an if Statement
3.6 Worked Example: Extracting the Middle
3.7 Computing and Society: The Denver Luggage Handling System
3.8 Multiple Alternatives
3.9 Special Topic: The switch Statement
3.10 Nested Branches
3.11 Special Topic: Enumeration Types
3.12 Problem Solving: Flowcharts
3.13 Problem Solving: Test Cases
3.14 Special Topic: Logging
3.15 Boolean Variables and Operators
3.16 Special Topic: Short-Circuit Evaluation of Boolean Operators
3.17 Special Topic: De Morgan’s Law
3.18 Application: Input Validation
3.19 Computing and Society: Artificial Intelligence
3.20 Chapter Summary
3.21 Review Exercises
3.22 Practice Exercises
3.23 Programming Projects

4.1 The while Loop
4.2 Computing and Society: The First Bug
4.3 Problem Solving: Hand-Tracing
4.4 The for Loop
4.5 The do Loop
4.6 Application: Processing Sentinel Values
4.7 Special Topic: The Loop-and-a-Half Problem and the break Statement
4.8 Special Topic: Redirection of Input and Output
4.9 Problem Solving: Storyboards
4.10 Common Loop Algorithms
4.11 How To: Writing a Loop
4.12 Worked Example: Credit Card Processing
4.13 Nested Loops
4.14 Worked Example: Manipulating the Pixels in an Image
4.15 Problem Solving: Solve a Simpler Problem First
4.16 Application: Random Numbers and Simulations
4.17 Special Topic: Drawing Graphical Shapes
4.18 Computing and Society: Digital Piracy
4.19 Chapter Summary
4.20 Review Exercises
4.21 Practice Exercises
4.22 Programming Projects

5.1 Methods as Black Boxes
5.2 Implementing Methods
5.3 Parameter Passing
5.4 Return Values
5.5 How To: Implementing a Method
5.6 Worked Example: Generating Random Passwords
5.7 Methods Without Return Values
5.8 Problem Solving: Reusable Methods
5.9 Computing and Society: Personal Computing
5.10 Problem Solving: Stepwise Refinement
5.11 Worked Example: Calculating a Course Grade
5.12 Variable Scope
5.13 Recursive Methods (Optional)
5.14 How To: Thinking Recursively
5.15 Chapter Summary
5.16 Review Exercises
5.17 Practice Exercises
5.18 Programming Projects

6.1 Arrays
6.2 Computing and Society: Computer Viruses
6.3 The Enhanced for Loop
6.4 Common Array Algorithms
6.5 Special Topic: Sorting with the Java Library
6.6 Special Topic: Binary Search
6.7 Using Arrays with Methods
6.8 Special Topic: Methods with a Variable Number of Parameters
6.9 Problem Solving: Adapting Algorithms
6.10 How To: Working with Arrays
6.11 Worked Example: Rolling the Dice
6.12 Problem Solving: Discovering Algorithms by Manipulating Physical Objects
6.13 Two-Dimensional Arrays
6.14 Special Topic: Two-Dimensional Arrays with Variable Row Lengths
6.15 Special Topic: Multidimensional Arrays
6.16 Worked Example: A World Population Table
6.17 Array Lists
6.18 Special Topic: The Diamond Syntax
6.19 Chapter Summary
6.20 Review Exercises
6.21 Practice Exercises
6.22 Programming Projects

7.1 Reading and Writing Text Files
7.2 Special Topic: Reading Web Pages
7.3 Special Topic: File Dialog Boxes
7.4 Special Topic: Reading and Writing Binary Data
7.5 Text Input and Output
7.6 Special Topic: Regular Expressions
7.7 Special Topic: Reading an Entire File
7.8 Command Line Arguments
7.9 How To: Processing Text Files
7.10 Worked Example: Analyzing Baby Names
7.11 Computing and Society: Encryption Algorithms
7.12 Exception Handling
7.13 Special Topic: Assertions
7.14 Special Topic: The try/finally Statement
7.15 Computing and Society: The Ariane Rocket Incident
7.16 Application: Handling Input Errors
7.17 Chapter Summary
7.18 Review Exercises
7.19 Practice Exercises
7.20 Programming Projects

8.1 Object-Oriented Programming
8.2 Implementing a Simple Class
8.3 Specifying the Public Interface of a Class
8.4 Special Topic: The javadoc Utility
8.5 Designing the Data Representation
8.6 Implementing Instance Methods
8.7 Constructors
8.8 Special Topic: Overloading
8.9 Testing a Class
8.10 How To: Implementing a Class
8.11 Worked Example: Implementing a Menu Class
8.12 Problem Solving: Tracing Objects
8.13 Computing and Society: Open Source and Free Software
8.14 Object References
8.15 Special Topic: Calling One Constructor from Another
8.16 Static Variables and Methods
8.17 Problem Solving: Patterns for Object Data
8.18 Computing and Society: Electronic Voting Machines
8.19 Packages
8.20 Special Topic: Package Access
8.21 How To: Programming with Packages
8.22 Chapter Summary
8.23 Review Exercises
8.24 Practice Exercises
8.25 Programming Projects

9.1 Inheritance Hierarchies
9.2 Implementing Subclasses
9.3 Overriding Methods
9.4 Special Topic: Calling the Superclass Constructor
9.5 Polymorphism
9.6 Special Topic: Dynamic Method Lookup and the Implicit Parameter
9.7 Special Topic: Abstract Classes
9.8 Special Topic: Final Methods and Classes
9.9 Special Topic: Protected Access
9.10 How To: Developing an Inheritance Hierarchy
9.11 Worked Example: Implementing an Employee Hierarchy for Payroll Processing
9.12 Object: The Cosmic Superclass
9.13 Special Topic: Inheritance and the toString Method
9.14 Special Topic: Inheritance and the equals Method
9.15 Interface Types
9.16 Special Topic: Constants in Interfaces
9.17 Special Topic: Generic Interface Types
9.18 Special Topic: Static Methods in Interfaces
9.19 Special Topic: Default Methods
9.20 Special Topic: Function Objects
9.21 Special Topic: Lambda Expressions
9.22 Worked Example: Investigating Number Sequences
9.23 Computing and Society: Who Controls the Internet?
9.24 Chapter Summary
9.25 Review Exercises
9.26 Practice Exercises
9.27 Programming Projects

10.1 Frame Windows
10.2 Special Topic: Adding the main Method to the Frame Class
10.3 Events and Event Handling
10.4 Special Topic: Local Inner Classes
10.5 Special Topic: Anonymous Inner Classes
10.6 Special Topic: Lambda Expressions for Event Handling
10.7 Processing Text Input
10.8 Creating Drawings
10.9 How To: Drawing Graphical Shapes
10.10 Worked Example: Coding a Bar Chart Creator
10.11 Chapter Summary
10.12 Review Exercises
10.13 Practice Exercises
10.14 Programming Projects

11.1 Layout Management
11.2 Choices
11.3 How To: Laying Out a User Interface
11.4 Worked Example: Programming a Working Calculator
11.5 Menus
11.6 Exploring the Swing Documentation
11.7 Using Timer Events for Animations
11.8 Mouse Events
11.9 Special Topic: Keyboard Events
11.10 Special Topic: Event Adapters
11.11 Worked Example: Adding Mouse and Keyboard Support to the Bar Chart Creator
11.12 Chapter Summary
11.13 Review Exercises
11.14 Practice Exercises
11.15 Programming Projects

12.1 Classes and Their Responsibilities
12.2 Relationships Between Classes
12.3 How To: Using CRC Cards and UML Diagrams in Program Design
12.4 Special Topic: Attributes and Methods in UML Diagrams
12.5 Special Topic: Multiplicities
12.6 Special Topic: Aggregation, Association, and Composition
12.7 Application: Printing an Invoice
12.8 Computing and Society: Databases and Privacy
12.9 Worked Example: Simulating an Automatic Teller Machine
12.10 Chapter Summary
12.11 Review Exercises
12.12 Practice Exercises
12.13 Programming Projects

13.1 Triangle Numbers
13.2 How To: Thinking Recursively
13.3 Worked Example: Finding Files
13.4 Recursive Helper Methods
13.5 The Efficiency of Recursion
13.6 Permutations
13.7 Computing and Society: The Limits of Computation
13.8 Mutual Recursion
13.9 Backtracking
13.10 Worked Example: Towers of Hanoi
13.11 Chapter Summary
13.12 Review Exercises
13.13 Practice Exercises
13.14 Programming Projects

14.1 Selection Sort
14.2 Profiling the Selection Sort Algorithm
14.3 Analyzing the Performance of the Selection Sort Algorithm
14.4 Special Topic: Oh, Omega, and Theta
14.5 Special Topic: Insertion Sort
14.6 Merge Sort
14.7 Analyzing the Merge Sort Algorithm
14.8 Special Topic: The Quicksort Algorithm
14.9 Searching
14.10 Computing and Society: The First Programmer
14.11 Problem Solving: Estimating the Running Time of an Algorithm
14.12 Sorting and Searching in the Java Library
14.13 Special Topic: The Comparator Interface
14.14 Special Topic: Comparators with Lambda Expressions
14.15 Worked Example: Enhancing the Insertion Sort Algorithm
14.16 Chapter Summary
14.17 Review Exercises
14.18 Practice Exercises
14.19 Programming Projects

15.1 An Overview of the Collections Framework
15.2 Linked Lists
15.3 Computing and Society: Standardization
15.4 Sets
15.5 Maps
15.6 Special Topic: Updating Map Entries
15.7 How To: Choosing a Collection
15.8 Worked Example: Word Frequency
15.9 Special Topic: Hash Functions
15.10 Stacks, Queues, and Priority Queues
15.11 Stack and Queue Applications
15.12 Worked Example: Simulating a Queue of Waiting Customers
15.13 Special Topic: Reverse Polish Notation
15.14 Chapter Summary
15.15 Review Exercises
15.16 Practice Exercises
15.17 Programming Projects

16.1 Implementing Linked Lists
16.2 Special Topic: Static Classes
16.3 Worked Example: Implementing a Doubly-Linked List
16.4 Implementing Array Lists
16.5 Implementing Stacks and Queues
16.6 Implementing a Hash Table
16.7 Special Topic: Open Addressing
16.8 Chapter Summary
16.9 Review Exercises
16.10 Practice Exercises
16.11 Programming Projects

17.1 Basic Tree Concepts
17.2 Binary Trees
17.3 Worked Example: Building a Huffman Tree
17.4 Binary Search Trees
17.5 Tree Traversal
17.6 Red-Black Trees
17.7 Worked Example: Implementing a Red-Black Tree
17.8 Heaps
17.9 The Heapsort Algorithm
17.10 Chapter Summary
17.11 Review Exercises
17.12 Practice Exercises
17.13 Programming Projects

18.1 Generic Classes and Type Parameters
18.2 Implementing Generic Types
18.3 Generic Methods
18.4 Constraining Type Parameters
18.5 Special Topic: Wildcard Types
18.6 Type Erasure
18.7 Special Topic: Reflection
18.8 Worked Example: Making a Generic Binary Search Tree Class
18.9 Chapter Summary
18.10 Review Exercises
18.11 Practice Exercises
18.12 Programming Projects

19.1 The Stream Concept
19.2 Producing Streams
19.3 Collecting Results
19.4 Special Topic: Infinite Streams
19.5 Transforming Streams
19.6 Lambda Expressions
19.7 Special Topic: Method and Constructor References
19.8 Special Topic: Higher-Order Functions
19.9 Special Topic: Higher-Order Functions and Comparators
19.10 The Optional Type
19.11 Other Terminal Operations
19.12 Primitive-Type Streams
19.13 Grouping Results
19.14 Common Algorithms Revisited
19.15 How To: Working with Streams
19.16 Worked Example: Word Properties
19.17 Worked Example: A Movie Database
19.18 Chapter Summary
19.19 Review Exercises
19.20 Practice Exercises
19.21 Programming Projects

20.1 Readers, Writers, and Input/Output Streams
20.2 Binary Input and Output
20.3 Random Access
20.4 Object Input and Output Streams
20.5 How To: Choosing a File Format
20.6 File and Directory Operations
20.7 Chapter Summary
20.8 Review Exercises
20.9 Practice Exercises
20.10 Programming Projects

21.1 Running Threads
21.2 Special Topic: Thread Pools
21.3 Terminating Threads
21.4 Race Conditions
21.5 Synchronizing Object Access
21.6 Avoiding Deadlocks
21.7 Special Topic: Object Locks and Synchronized Methods
21.8 Special Topic: The Java Memory Model
21.9 Application: Algorithm Animation
21.10 Chapter Summary
21.11 Review Exercises
21.12 Practice Exercises
21.13 Programming Projects

22.1 The Internet Protocol
22.2 Application Level Protocols
22.3 A Client Program
22.4 A Server Program
22.5 How To: Designing Client/Server Programs
22.6 URL Connections
22.7 Chapter Summary
22.8 Review Exercises
22.9 Practice Exercises
22.10 Programming Projects

23.1 Organizing Database Information
23.2 Special Topic: Primary Keys and Indexes
23.3 Queries
23.4 Installing a Database
23.5 Database Programming in Java
23.6 Application: Entering an Invoice
23.7 Special Topic: Transactions
23.8 Special Topic: Object-Relational Mapping
23.9 Worked Example: Programming a Bank Database
23.10 Chapter Summary
23.11 Review Exercises
23.12 Practice Exercises
23.13 Programming Projects

24.1 XML Tags and Documents
24.2 How To: Designing an XML Document Format
24.3 Parsing XML Documents
24.4 Creating XML Documents
24.5 How To: Writing an XML Document
24.6 Special Topic: Grammars, Parsers, and Compilers
24.7 Validating XML Documents
24.8 How To: Writing a DTD
24.9 Special Topic: Schema Languages
24.10 Special Topic: Other XML Technologies
24.11 Chapter Summary
24.12 Review Exercises
24.13 Practice Exercises
24.14 Programming Projects

The interactive zyBooks version of a classic introduction to programming

The Big Java: Late Objects zyVersion offers the complete contents of the 2nd edition of this popular textbook, plus new immersive activities and integrated live coding to help beginning programmers learn faster and more effectively.

  • Suitable for a two-semester introduction to programming sequence
  • Focuses on fundamental programming techniques and design skills, helping students master basic concepts and become competent coders
  • Includes over 80 Parsons problems, code-writing exercises with a live compiler, and hundreds of auto-graded learning questions
  • Adopters have access to an integrated test bank with over 1900 questions

“In a CS1 course, you want to stress concepts that will prepare students for advanced learning, not just teach them a programming language; in our book we purposefully go deeper to give students that foundation.”
Author Cay Horstmann

Dr. Cay Horstmann on the benefits of teaching with zyBooks

What is a zyVersion?

zyVersions are leading print titles converted and adapted to zyBooks’ interactive learning platform, allowing for a quick and easy transition to an engaging digital experience for instructors and students.

zyBooks’ web-native content helps students visualize concepts to learn faster and more effectively than with a traditional textbook. (Check out our research.)

This zyVersion of Big Java Late Objects benefits both students and instructors:

  • Instructor benefits
  • Customize your course by reorganizing existing content or adding your own
  • Continuous publication model updates your course with the latest content and technologies
  • Robust reporting gives you insight into students’ progress, reading and participation
  • Animations and other interactive content can be shown in presentation mode and used during a lecture
  • Student benefits
  • Learning questions and other content serve as an interactive form of reading
  • Instant feedback on labs and homework
  • Concepts come to life through extensive animations embedded into the interactive content
  • Save chapters as PDFs to reference the material at any time

Animated learning activity embedded into the Big Java Late Objects zyVersion:

Big Java: Late Objects (2e) - Cay Horstmann


Cay Horstmann, PhD
Professor of Computer Science, San Jose State University

Instructors: Interested in evaluating this zyBook for your class?