This course uses Think Java 2nd Edition by Allen B. Downey, which is available in HTML and PDF for free. You can also buy the paperpack at Amazon.com.

Table of Contents

Computer programming

+

What is a computer?

What is programming?

Hello, World

Compiling Java programs

Displaying messages

Formatting source code

What is computer science?

Variables and operators

+

Declaring variables

Assigning variables

Memory diagrams

printing variables

Arithmetic operators

Floating-point numbers

Rounding errors

String operators

Input and Output

+

The System class

The Scanner class

Language elements

Literals and constants

Formatting output

Error messages

Type cast operators

Remainder Operator

Methods and testing

+

Defining new methods

Parameters and arguments

Stack Diagrams

Math methods

Composition

Return values

Incremental development

Conditionals and logic

+

Relational operators

The if-else statement

Chaining and nesting

The switch statement

Logical operators

Boolean variables

Boolean methods

Validating input

Loops and strings

+

The while statement

The for statement

Nested loops

Characters

String iteration

The indexOf method

Substrings

String comparison

String formatting

Arrays and references

+

Creating arrays

Accessing elements

Displaying arrays

Copying arrays

Traversing arrays

Random numbers

Building a histogram

The enhanced for loop

Counting characters

Recursive methods

+

Recursive void methods

Recursive stack diagrams

Value-Returning methods

The leap of faith

Counting up recursively

Binary number system

Recursive binary method

CodingBat problems

Immutable objects

+

Primitives vs Objects

The null Keyword

Strings Are Immutable

Wrapper Classes

Command-Line Arguments

Argument Validation

BigInteger Arithmetic

Mutable objects

+

Point Objects

Objects as Parameters

Objects as Return Values

Rectangles Are Mutable

Aliasing Revisited

Class Diagrams

Mutable vs Immutable

StringBuilder Objects

Designing classes

+

The Time class

Constructors

Getters and setters

Displaying objects

The toString method

The equals method

Adding Times

Arrays of objects

+

Card objects

Card toString

Class variables

The compareTo method

Cards are immutable

Arrays of Cards

Sequential search

Binary search

Objects of arrays

+

Decks of Cards

Shuffling Decks

Selection sort

Merge sort

Subdecks

Merging Decks

Adding recursion

Static context

Piles of Cards

Playing war

Extending classes

+

CardCollection

Inheritance

Dealing Cards

The Player class

The Eights class

Class relationships

Arrays of arrays

+

Conway’s game of life

The cell class

Two-dimensional arrays

The GridCanvas class

Other Grid methods

Starting the game

Exception handling

Counting neighbors

Updating the Grid

Reusing Classes

+

Langton’s ant

Refactoring

Abstract classes

UML diagram

Advanced topics

+

Polygon objects

Adding color

Regular Polygons

More constructors

An initial drawing

Blinking Polygons

Interfaces

Event Listeners

Timers

Resources and Tools

+

Resources

Tools