1. An Introduction to
Computers and Java
1.1 What Is a Computer?
1.2 The Hardware
1.3 The Software
1.4
Programming and Algorithms
2. Expressions and Data Type
2.1 In the Beginning… (Programs that Print)
2.2
Data Types and Expressions
3. Variables and Assignment
3.1 Variables
3.2 Variable Declarations: How a Program Obtains Storage for Data
3.3 How a Program Stores Data: Initialization and Assignment
3.4 How a Program Uses Stored Data
3.5 Obtaining Data From Outside a Program
3.6 Using a Scanner Object for Interactive Input
3.7 Final variables
3.8 Type Compatibility and Casting
3.9 A Few Shortcut Operators
3.10
Increment and Decrement Operators
4. Selection and Decision: if
Statements
4.1 The if Statement
4.2 The if-else Statement
4.3
The switch Statement
5. Repetition
5.1 The while statement
5.2 Loops: a Source of Power; a Source of Bugs
5.3 The do-while Statement
5.4 The for Statement
5.5 Nested Loops
5.6 The break Statement, revisited
6. Methods
6.1 Java's
Pre-defined Methods
6.2 Writing Your Own Methods
6.3 Method Overloading
7. Arrays and Lists
7.1 Array Fundamentals:
Declaration and Instantiation
7.2 Using an Array
7.3 Array Initialization
7.4
Using the = and the == Operators
7.5 Arrays and Methods
7.6 Sorting an Array with Insertion Sort
7.7 Searching an Array
7.8
Two Dimensional Arrays
8. Recursion
8.1 Recursive Thinking
8.2 The Runtime Stack: Tail Recursion vs. Classic Recursion
8.3 Quicksort - A Classic Recursive Algorithm
8.4
Designing an Anagram Generator
9. Objects and Classes I:
Encapsulation
9.1 Classes and Objects
9.2 Java Libraries and Packages
9.3 Strings are Objects
9.4 The StringBuilder Class
9.5 Classes for handling Files
9.6 The DecimalFormat class
10. Objects and Classes II:
Writing Your Own Classes
10.1 A Dice Class
10.2 Using the Dice Class
10.3 A TriviaTest Class
10.4 Encapsulation and Information Hiding
10.5
The Keyword static
10.6
The Keyword this
10.7 Garbage Collection
10.8 A Case Study: Classy Sounds