Every lesson in the Java slide course, in full text: 39 decks, 2573 slides.
Tools: the Command Line, Checkstyle, and JUnitThe machinery the main text kept out of the way: what a JDK and a JVM actually are, the four command-line commands worth learning first, redirecting a test file into System.in so you never retype input again, Checkstyle, a debugger's breakpoints and call stack, and JUnit's assertEquals. Follows Think Java 2e, Chapter A (Tools), Sections A.1-A.8, pp. 297-307, cross-referenced against The Java Tutorials — The javac and java Commands.
Javadoc: Reading and Writing DocumentationJava's three kinds of comment and who each is written for, how to read a library class's documentation page — signature, returns, throws — and how to write your own so that the javadoc tool turns it into exactly the same kind of page. Follows Think Java 2e, Chapter B (Javadoc), Sections B.1-B.5, pp. 309-318, cross-referenced against Oracle — How to Write Doc Comments for the Javadoc Tool.
Graphics: Drawing with Java's LibrariesThe graphics appendix Chapter 15 tells you to read first: a Canvas you extend, a paint method the window system calls, a coordinate system whose origin is in the upper-left corner, bounding boxes, RGB colours, and a Hidden Mickey drawn with three ovals and a Rectangle. Follows Think Java 2e, Chapter C (Graphics), Sections C.1-C.5, pp. 319-324, cross-referenced against Java SE 21 API — java.awt.Graphics.
Debugging: Compile-Time, Run-Time, and Logic ErrorsThe last lesson: everything the book has said about debugging, organised by the question that decides the strategy — is this a compile-time, run-time or logic error? Includes bisection, tracing a loop's condition, reading a stack trace, the minimal test case, and the rubber duck. Follows Think Java 2e, Chapter D (Debugging), Sections D.1-D.3, pp. 327-340, cross-referenced against The Java Tutorials — What Is an Exception?.
What a Program Is, and Your First OneWhat a computer is underneath the screen, what a program is made of, and the anatomy of Hello World — class, method, statement — followed by the two commands that turn source code into output. Follows Think Java 2e, Chapter 1 (Computer Programming), Sections 1.1-1.4, pp. 1-6, cross-referenced against The Java Tutorials — Getting Started: The 'Hello World!' Application.
Printing, Escape Sequences, and DebuggingPutting several statements in main, the difference between print and println, which spaces Java actually requires, the four escape sequences worth memorising, and why deliberately breaking your own program is a study technique rather than a waste of time. Follows Think Java 2e, Chapter 1 (Computer Programming), Sections 1.5-1.9, pp. 6-12, cross-referenced against The Java Tutorials — Characters (escape sequences).
Variables, Memory Diagrams, and ArithmeticDeclaring a variable, assigning to it, and drawing the result as a memory diagram — then printing variables and combining them with arithmetic operators, including the integer division that surprises everyone the first time. Follows Think Java 2e, Chapter 2 (Variables and Operators), Sections 2.1-2.5, pp. 17-23, cross-referenced against The Java Tutorials — Variables.
Floating-Point, Strings, and the Three Kinds of ErrorThe double type and the integer-division trap it is meant to solve, why 0.1 added ten times is not 1.0, what the plus operator does to strings, the order of operations, and the three kinds of error every programmer learns to tell apart. Follows Think Java 2e, Chapter 2 (Variables and Operators), Sections 2.6-2.10, pp. 23-29, cross-referenced against The Java Tutorials — Primitive Data Types.
Scanner, Constants, and Formatted OutputWhere System.out actually comes from, how to read input from the keyboard with a Scanner, the vocabulary that makes compiler errors readable, naming magic numbers with final, and printf for output you control to the decimal place. Follows Think Java 2e, Chapter 3 (Input and Output), Sections 3.1-3.5, pp. 33-40, cross-referenced against Java SE 21 API — java.util.Scanner.
Casts, the Remainder Operator, and the Scanner BugReading a stack trace, converting a double to an int with a cast, using the remainder operator to split a quantity into units, the structure of a complete conversion program, and the Scanner bug that eats your input. Follows Think Java 2e, Chapter 3 (Input and Output), Sections 3.6-3.10, pp. 40-46, cross-referenced against The Java Tutorials — Assignment, Arithmetic, and Unary Operators.
Defining Methods, Parameters, and Stack DiagramsWriting your own methods, following the flow of execution as it detours from one to another, passing arguments into parameters, and drawing the stack diagram that shows which variables exist and where. Follows Think Java 2e, Chapter 4 (Methods and Testing), Sections 4.1-4.5, pp. 51-58, cross-referenced against The Java Tutorials — Defining Methods.
Return Values, Composition, and Incremental DevelopmentThe Math class and its constants, composing method calls the way you compose mathematical functions, writing methods that return a value, and the incremental method that keeps you from ever debugging more than a line or two at a time. Follows Think Java 2e, Chapter 4 (Methods and Testing), Sections 4.6-4.9, pp. 58-64, cross-referenced against The Java Tutorials — Returning a Value from a Method.
Relational Operators, if-else, and switchThe six relational operators and the boolean type they produce, if and if-else, the optional braces and stray semicolons that have caused real production bugs, chaining and nesting conditionals, and the switch statement. Follows Think Java 2e, Chapter 5 (Conditionals and Logic), Sections 5.1-5.4, pp. 71-77, cross-referenced against The Java Tutorials — The if-then and if-then-else Statements.
Logical Operators, Booleans, and Validating InputThe three logical operators and the short-circuit evaluation that makes them safe, De Morgan's laws for negating a condition readably, boolean variables and methods, and the input validation that turns five lines of code into a program you could give to a stranger. Follows Think Java 2e, Chapter 5 (Conditionals and Logic), Sections 5.5-5.10, pp. 77-84, cross-referenced against The Java Tutorials — Equality, Relational, and Conditional Operators.
while, for, and Nested LoopsThe while loop and the infinite loop that lurks beside it, the increment and decrement operators, the for loop that puts all the control in one line, nested loops, and characters — plus the rule for choosing between the two kinds of loop. Follows Think Java 2e, Chapter 6 (Loops and Strings), Sections 6.1-6.6, pp. 89-98, cross-referenced against The Java Tutorials — The for Statement.
The String Toolkit: Iteration, indexOf, and substringIterating over a string's characters and the off-by-one that ends in an exception, indexOf for searching, substring for extracting, why == is almost never the right way to compare strings, and String.format for building formatted text you do not immediately print. Follows Think Java 2e, Chapter 6 (Loops and Strings), Sections 6.7-6.11, pp. 98-103, cross-referenced against The Java Tutorials — Strings.
Creating, Accessing, Copying, and Traversing ArraysStoring many values of one type in a single variable: creating arrays, selecting elements with the bracket operator, why printing an array gives you an address, the difference between copying a reference and copying an array, and the three traversal patterns you will use for the rest of the book. Follows Think Java 2e, Chapter 7 (Arrays and References), Sections 7.1-7.5, pp. 107-115, cross-referenced against The Java Tutorials — Arrays.
Random Numbers, Histograms, and the Enhanced for LoopPseudorandom numbers and why a computer cannot produce real ones, counting values into a histogram, the single-pass trick of using a value as an index, the enhanced for loop, and the doubloon program that pulls the whole chapter together. Follows Think Java 2e, Chapter 7 (Arrays and References), Sections 7.6-7.9, pp. 115-121, cross-referenced against Java SE 21 API — java.util.Random.
Recursive Void Methods and the Leap of FaithA method that invokes itself: the countdown that unwinds, the stack diagram that explains it, the base case that stops it, factorial derived straight from its mathematical definition, and the leap of faith that lets you write a recursive method without tracing it. Follows Think Java 2e, Chapter 8 (Recursive Methods), Sections 8.1-8.4, pp. 127-134, cross-referenced against Java SE 21 API — java.lang.StackOverflowError.
Counting Up, Binary Numbers, and Recursive PracticeMoving one line to make a countdown count up, the binary number system and repeated division, a recursive method that prints a number in binary, and two CodingBat problems that share the same recursive shape — one over a string and one over an array. Follows Think Java 2e, Chapter 8 (Recursive Methods), Sections 8.5-8.8, pp. 134-140, cross-referenced against Java SE 21 API — Integer.toBinaryString.
Primitives vs Objects, null, and Immutable StringsWhat separates a primitive from an object, the null reference and the exception it throws, why no String method can ever change a string, and the wrapper classes that let a number behave like an object — including the methods that convert between text and numbers. Follows Think Java 2e, Chapter 9 (Immutable Objects), Sections 9.1-9.4, pp. 147-152, cross-referenced against Java SE 21 API — java.lang.String.
Command-Line Arguments, BigInteger, and Incremental DesignThe args parameter explained at last, validating what arrives from outside the program, BigInteger for numbers too large for a long, and the encapsulate-and-generalize process that turns a few working lines into a reusable method. Follows Think Java 2e, Chapter 9 (Immutable Objects), Sections 9.5-9.9, pp. 152-160, cross-referenced against Java SE 21 API — java.math.BigInteger.
Point, Rectangle, and Why Mutability BitesObjects with attributes you can reach: creating Points and Rectangles, reading their data with dot notation, passing objects to methods and returning new ones, changing an object's attributes, and the aliasing that makes mutable objects genuinely hard to debug. Follows Think Java 2e, Chapter 10 (Mutable Objects), Sections 10.1-10.5, pp. 167-173, cross-referenced against Java SE 21 API — java.awt.Point.
Class Diagrams, Scope, Garbage Collection, and StringBuilderReading the Java library's own source, summarising a class with a UML diagram, the three kinds of variable a method can see, what happens to an object nobody refers to any more, and the mutable class that exists because building a long string out of immutable ones is wasteful. Follows Think Java 2e, Chapter 10 (Mutable Objects), Sections 10.6-10.11, pp. 173-179, cross-referenced against Java SE 21 API — java.lang.StringBuilder.
Writing a Class: Constructors, Getters, and SettersDefining a class of your own: instance variables kept private, constructors that initialise them, overloading so an object can be built two ways, and the getters and setters that let other classes reach the data without depending on how it is stored. Follows Think Java 2e, Chapter 11 (Designing Classes), Sections 11.1-11.4, pp. 183-190, cross-referenced against The Java Tutorials — Providing Constructors for Your Classes.
toString, equals, and Methods That Combine ObjectsMaking an object display itself with toString, deciding what it means for two objects to be equal, the difference between a static method and an instance method, and an add method that is presented wrong on purpose so that carrying can be added to it. Follows Think Java 2e, Chapter 11 (Designing Classes), Sections 11.5-11.8, pp. 190-196, cross-referenced against Java SE 21 API — java.lang.Object (toString, equals).
Card Objects, Class Variables, and compareToEncoding suits and ranks as integers so cards can be compared, decoding them back into words with an array of Strings, class variables shared by every object, a compareTo that imposes an order on a partially ordered set, and the decision to make cards immutable. Follows Think Java 2e, Chapter 12 (Arrays of Objects), Sections 12.1-12.5, pp. 201-208, cross-referenced against Java SE 21 API — java.lang.Comparable.
Arrays of Cards: Sequential and Binary SearchAn array of Cards holds references, all null until you fill them, and a nested loop fills all fifty-two. Then two ways to find a card in that array: looking at every element in turn, and — because the array is sorted and Card has compareTo — throwing away half the array with every comparison. Follows Think Java 2e, Chapter 12 (Arrays of Objects), Sections 12.6-12.9, pp. 208-213, cross-referenced against Java SE 21 API — java.util.Arrays (binarySearch).
Decks, Shuffling, Selection Sort, and Merge SortA Deck class whose instance variable is an array of Cards, pseudocode as a way of discovering which helper methods you need, shuffling by repeated swaps, selection sort and why it is quadratic, and merge sort — which needs subdecks and a merge before it can be written at all. Follows Think Java 2e, Chapter 13 (Objects of Arrays), Sections 13.1-13.6, pp. 217-224, cross-referenced against Java SE 21 API — java.util.Collections (shuffle, sort).
Recursive Merge Sort, Static Context, and Piles of CardsTurning almostMergeSort into real merge sort by replacing one call with a recursive one, the two base cases that make it terminate, the static-context error messages spelled out at last, and ArrayList — a collection that grows and shrinks — used to build the piles for a game of War. Follows Think Java 2e, Chapter 13 (Objects of Arrays), Sections 13.7-13.10, pp. 224-230, cross-referenced against The Java Tutorials — Understanding Class Members (static).
CardCollection and InheritanceDeck and Pile were two versions of the same code, so this lesson merges them into a CardCollection and then uses `extends` to put back the differences: a Deck is a CardCollection with a different constructor, and a Hand is a CardCollection with one extra method. Plus the substitution rule that makes it all worth it. Follows Think Java 2e, Chapter 14 (Extending Classes), Sections 14.1-14.3, pp. 233-240, cross-referenced against The Java Tutorials — Inheritance.
Players, the Game Loop, and Class RelationshipsThe Crazy Eights rules at last, in a Player class that decides which card to play and an Eights class that holds the state of the game — assembled by bottom-up design, the counterpart to Chapter 13's top-down. Then the two relationships every object-oriented design is made of: HAS-A and IS-A. Follows Think Java 2e, Chapter 14 (Extending Classes), Sections 14.4-14.6, pp. 240-247, cross-referenced against The Java Tutorials — Overriding and Hiding Methods.
Two-Dimensional Arrays and the Game of Life GridConway's Game of Life, its three rules, and the classes that draw it: a Cell that knows its own coordinates and state, a two-dimensional array — which in Java is really an array of arrays — and a GridCanvas that is a Canvas and has a grid of cells. Follows Think Java 2e, Chapter 15 (Arrays of Arrays), Sections 15.1-15.6, pp. 249-257, cross-referenced against The Java Tutorials — Arrays (multidimensional).
The Simulation Loop, Exceptions, and Counting NeighborsA while loop that never ends, a compiler error that forces you to learn try-catch, and then try-catch used again on purpose — to let a cell on the edge of the grid count neighbours that do not exist. Finished by the two-pass update that makes all the cells change at once. Follows Think Java 2e, Chapter 15 (Arrays of Arrays), Sections 15.7-15.10, pp. 257-263, cross-referenced against The Java Tutorials — Catching and Handling Exceptions.
Refactoring, Abstract Classes, and UMLA second zero-player game — Langton's Ant — reusing Cell and GridCanvas unchanged, which leaves two copies of main and mainloop. Removing that duplication introduces refactoring, and then `protected`, `abstract` and the distinction between an abstract and a concrete class. Follows Think Java 2e, Chapter 16 (Reusing Classes), Sections 16.1-16.4, pp. 267-274, cross-referenced against The Java Tutorials — Abstract Methods and Classes.
Polygon Objects, Color, and More ConstructorsGeneralization and specialization named at last, then two rounds of specialising a library class: a DrawablePolygon that adds colour to java.awt.Polygon, and a RegularPolygon that computes its own vertices with trigonometry. Plus constructor chaining with this(...) and throwing an exception to reject bad arguments. Follows Think Java 2e, Chapter 17 (Advanced Topics), Sections 17.1-17.4, pp. 277-283, cross-referenced against Java SE 21 API — java.awt.Polygon.
Drawing, Blinking, and InterfacesA Drawing that holds a list of polygons and draws them all, an animation that makes them blink, and then the problem: to draw anything other than a polygon the code must be generalised, but DrawablePolygon already extends Polygon. Interfaces are Java's answer, and polymorphism is the name for what has been happening all along. Follows Think Java 2e, Chapter 17 (Advanced Topics), Sections 17.5-17.7, pp. 283-290, cross-referenced against The Java Tutorials — Defining an Interface.
Event Listeners and TimersA Sprite that reads an image from a file and implements two interfaces at once, keyboard events delivered by methods the window system calls, and a Timer that replaces the while(true) loop that has driven every animation since Chapter 15. The last lesson of the book. Follows Think Java 2e, Chapter 17 (Advanced Topics), Sections 17.8-17.9, pp. 290-295, cross-referenced against The Java Tutorials — Introduction to Event Listeners.
Recursion - Building the printArray() AssignmentA 60-minute assignment-completion lesson in 62 slides. It defines a recursive method as a base case plus a recursive step, traces printArray by hand on a three-element array so you can watch the call stack grow and unwind, and then scaffolds the graded assignment in eight steps: a 100-element array filled by a for loop with rand.nextInt(100) + 1 and printed space-separated by a recursive printArray. Five traps cover the crashes that actually happen - deleting the base case and hitting ArrayIndexOutOfBoundsException, stopping one element early, expecting nextInt(100) to include 100 when it returns 0 through 99, using println and printing a column instead of a row, and forgetting the + 1, which produces a StackOverflowError past a thousand frames. The deck ends with a section on screenshots and submission, on the principle that you only get credit for what you demonstrate, and two extensions that prove you own the material: printing backwards by swapping two lines, and writing a recursive sum. Every snippet, output, error message, and stack trace was compiled and executed under OpenJDK Temurin 21.0.11.
Want this taught 1-on-1? Alexander tutors Java — $55/session, free consultation.