1.
Prelude
❱
1.1.
Asking for Help
1.2.
Toy Problems
1.3.
Lies
1.4.
AI
2.
Getting Started
3.
First Steps
❱
3.1.
Comments
3.2.
Semicolons
3.3.
Formatting
3.4.
Challenges
4.
Local Variables
❱
4.1.
Naming
4.2.
Reassignment
4.3.
Delayed Assignment
4.4.
Types
4.5.
Final Variables
4.6.
Inferred Types
4.7.
Challenges
Data Types I
5.
Booleans
❱
5.1.
Not
5.2.
And
5.3.
Or
5.4.
Operator Precedence
5.5.
Challenges
6.
Integers
❱
6.1.
Integer Literals
6.2.
Addition
6.3.
Subtraction
6.4.
Multiplication
6.5.
Division
6.6.
Remainder
6.7.
Equality
6.8.
Comparison
6.9.
Chained Comparisons
6.10.
Operator Precedence
6.11.
Reassignment
6.12.
Shorthands for Reassignment
6.13.
Limits
6.14.
Challenges
7.
Floating Point Numbers
❱
7.1.
Floating Point Literals
7.2.
Accuracy
7.3.
Addition
7.4.
Subtraction
7.5.
Multiplication
7.6.
Division
7.7.
Equality
7.8.
Comparison
7.9.
Shorthands for Reassignment
7.10.
NaN
7.11.
Positive and Negative Infinity
7.12.
Square Root
7.13.
Conversion to Integers
7.14.
Conversion from Integers
7.15.
Challenges
8.
Characters
❱
8.1.
Character Literals
8.2.
Common Escape Sequences
8.3.
Conversion to Integers
8.4.
Conversion from Integers
8.5.
Unicode
8.6.
Challenges
9.
Strings
❱
9.1.
String Literals
9.2.
Common Escape Sequences
9.3.
The Empty String
9.4.
Multiline String Literals
9.5.
Concatenation
9.6.
Equality
9.7.
Length
9.8.
Access Individual Characters
9.9.
Challenges
Interactive Programs
10.
Standard Input
❱
10.1.
Prompting
10.2.
Interpreting Input
10.3.
Integers
10.4.
Floating Point Numbers
10.5.
Other Types
10.6.
Challenges
Control Flow I
11.
Branching Paths
❱
11.1.
If
11.2.
Nested Ifs
11.3.
Else
11.4.
Else If
11.5.
Relation to Delayed Assignment
11.6.
Scoped Variables
11.7.
Conditional Operator
11.8.
Boolean Expressions
11.9.
Challenges
12.
Loops
❱
12.1.
While
12.2.
Endless Loops
12.3.
Break
12.4.
Continue
12.5.
Unreachable Code
12.6.
Do While
12.7.
Nested Loops
12.8.
Labeled Break
12.9.
Labeled Continue
12.10.
Iteration
12.11.
Counting Up
12.12.
Counting Down
12.13.
Iterate over a String
12.14.
Challenges
Projects
13.
Prelude
14.
Calorie Tracker
Data Types II
15.
Arrays
❱
15.1.
Array Initializers
15.2.
Length
15.3.
Access Individual Elements
15.4.
Set Individual Elements
15.5.
Aliasing
15.6.
Reassignment
15.7.
Relation to Final Variables
15.8.
Printing the Contents of an Array
15.9.
Empty Array
15.10.
Difference between Initializer and Literal
15.11.
Initialization with new
15.12.
Challenges
Control Flow II
16.
Loops II
❱
16.1.
For
16.2.
For Syntax
16.3.
Counting Up and Down
16.4.
Iterate over a String
16.5.
Iterate over an Array
16.6.
Comparison to while
16.7.
i
16.8.
Break
16.9.
Continue
16.10.
Delayed Assignment
16.11.
Inferred Types
16.12.
Empty Initializers
16.13.
Empty Expressions
16.14.
Empty Statements
16.15.
Final Variables
16.16.
Labeled Break
16.17.
Labeled Continue
16.18.
Drawing Right Triangles
16.19.
Drawing Isosceles Triangles
16.20.
Challenges
Projects
17.
Can you Build a Snowman?
Code Structure
18.
Methods
❱
18.1.
Declaration
18.2.
Invocation
18.3.
Scope
18.4.
main
18.5.
Challenges
19.
Arguments
❱
19.1.
Declaration
19.2.
Invocation with Arguments
19.3.
Reassignment
19.4.
Final Arguments
19.5.
Aliasing
19.6.
Overloading
19.7.
Inferred Types
19.8.
Challenges
20.
Return Values
❱
20.1.
Declaration
20.2.
Return Statement
20.3.
Exhaustiveness
20.4.
void
20.5.
Return in void methods
20.6.
Conversion
20.7.
Unreachable Statements
20.8.
Challenges
Projects
21.
Tic-Tac-Toe
22.
Chicken Nugget Numbers
Data Types III
23.
null
❱
23.1.
Null as Absence
23.2.
Null as Unknown
23.3.
Checking for null
23.4.
NullPointerException
23.5.
Challenges
24.
Boxed Primitives
❱
24.1.
Integer
24.2.
Double
24.3.
Character
24.4.
Boolean
24.5.
Unboxing Conversion
24.6.
Boxing Conversion
24.7.
Arrays of Boxed Primitives
24.8.
Challenges
25.
Arrays II
❱
25.1.
Initializion with Size
25.2.
Default Values
25.3.
Populate Arrays
25.4.
Challenges
Projects II
26.
Ultimate Tic-Tac-Toe
Code Structure II
27.
Classes
❱
27.1.
The meaning of the word Class
27.2.
Class Declaration
27.3.
Naming
27.4.
Instances
27.5.
Fields
27.6.
Field Initialization
27.7.
Field Access
27.8.
Field Default Values
27.9.
Aliasing
27.10.
Return Multiple Values
27.11.
Challenges
28.
Instance Methods
❱
28.1.
Invocation
28.2.
Arguments
28.3.
Field Access
28.4.
Field Updates
28.5.
Derived Values
28.6.
Invoke Other Methods
28.7.
this
28.8.
Disambiguation
28.9.
Clarity
28.10.
Challenges
Projects II
29.
Monte Carlo Sampling
Data Types IV
30.
Enums
❱
30.1.
Declaration
30.2.
Variants
30.3.
Naming
30.4.
Usage
30.5.
Equality
30.6.
Comparison to boolean
30.7.
Challenges
31.
Strings II
❱
31.1.
lowercase
31.2.
UPPERCASE
31.3.
Equality ignoring case
31.4.
Check if empty
31.5.
Check if blank
31.6.
Strip extra whitespace
31.7.
Challenges
Control Flow III
32.
Exceptions
❱
32.1.
throw
32.2.
Messages
32.3.
Stack Traces
32.4.
try/catch
32.5.
Challenges
33.
Switch
❱
33.1.
Case and Default
33.2.
Strings
33.3.
ints
33.4.
Enums
33.5.
Omitted Default
33.6.
Exhaustiveness
33.7.
Combining Cases
33.8.
null
33.9.
Challenges
Code Structure III
34.
Constructors
❱
34.1.
Declaration
34.2.
The Default Constructor
34.3.
Arguments
34.4.
Final Fields
34.5.
Invariants
34.6.
Overloads
34.7.
Delegation
34.8.
Challenges
35.
Global Fields
❱
35.1.
Default Values
35.2.
Final Fields
35.3.
Field Access
35.4.
Inferred Types
35.5.
Challenges
Concepts
36.
Code is Read more than Written
❱
36.1.
Meaning
36.2.
Implications
36.3.
Information Density
36.4.
Audience
36.5.
Practice
Interactive Programs
37.
Standard Input II
❱
37.1.
Prompting
37.2.
Interpreting Input
37.3.
Reprompting
37.4.
Leniency
37.5.
Delayed Assignment
37.6.
Transporting Data
The Computing Environment
38.
Hardware
❱
38.1.
CPU
38.2.
RAM
38.3.
Hard Drives
38.4.
Motherboard
39.
Operating Systems
❱
39.1.
Personal Computers
39.2.
Servers
39.3.
Mobile Phones
39.4.
Game Consoles
39.5.
Abstractions
39.6.
Defaults
40.
The Terminal
❱
40.1.
Bash
40.2.
Windows Subsystem for Linux
40.3.
Chromebooks and School Computers
40.4.
Commands
40.5.
Directories
40.6.
Listing Files
40.7.
Creating Directories
40.8.
Changing Directories
40.9.
Creating Files
40.10.
Run Java Programs
40.11.
Getting Used to it
Control Flow IV
41.
Exceptions II
❱
41.1.
Checked Exceptions
41.2.
Unchecked Exceptions
41.3.
throws
41.4.
Propagating Exceptions
41.5.
Rethrowing Exceptions
41.6.
Exception
41.7.
RuntimeException
41.8.
main
42.
Switch II
❱
42.1.
Yield
42.2.
Omitted Yield
42.3.
Exhaustiveness
42.4.
Return a Switch
Code Structure IV
43.
Multi-File Programs
❱
43.1.
The Sources folder
43.2.
The Main file
43.3.
A Second file
43.4.
File names
43.5.
The Anonymous Main Class
43.6.
Global Fields
44.
Visibility
❱
44.1.
Private Methods
44.2.
Private Fields
44.3.
Invariants
44.4.
Accessors
44.5.
Getters and Setters
45.
Static Fields
❱
45.1.
Declaration
45.2.
Initialization
45.3.
Usage
45.4.
Constants
45.5.
Controversy
45.6.
Naming
46.
Static Methods
❱
46.1.
Declaration
46.2.
Scope
46.3.
Naming
46.4.
Usage
46.5.
Math
46.6.
Factories
Data Structures & Algorithms
47.
Growable Arrays
❱
47.1.
Concept
47.2.
Simple Implementation
47.3.
Usage
47.4.
Performance Problems
47.5.
Performance Solutions
47.6.
Optimized Implementation
Interactive Programs II
48.
Command Line Arguments
❱
48.1.
Accessing Arguments
48.2.
Conventions
Code Structure V
49.
Inner Classes
❱
49.1.
Type
49.2.
Instances
49.3.
New Operator
49.4.
Scope
49.5.
Disambiguation
49.6.
The anonymous main class
49.7.
Static Inner Classes
49.8.
Private Inner Classes
50.
Packages
❱
50.1.
Declaration
50.2.
Visibility
50.3.
Public Classes
50.4.
Fully Qualified Class Name
50.5.
Import
50.6.
The Default Package
50.7.
The Anonymous Main Class
50.8.
Public Methods
50.9.
Package-Private Methods
50.10.
Public Fields
50.11.
Package-Private Fields
50.12.
The Default Constructor
50.13.
Public Constructors
50.14.
Package-Private Constructors
50.15.
Subpackages
50.16.
Reverse Domain Name Notation
Data Types IV
51.
Records
❱
51.1.
Declaration
51.2.
The Canonical Constructor
51.3.
Component Accessors
51.4.
Component Accessor Visibility
51.5.
Printing a Record
51.6.
Check for Equality
51.7.
Return Multiple Values
51.8.
Shorthand
52.
Integers II
❱
52.1.
Integer from a String
52.2.
Integer to a String
52.3.
Base 16 Integer Literals
52.4.
Integer from a Base 16 String
52.5.
Integer to a Base 16 String
52.6.
Underscores in Integer Literals
Interactive Programs III
53.
Files
❱
53.1.
Paths
53.2.
IOException
53.3.
UncheckedIOException
53.4.
Write to a File
53.5.
Read from a File
53.6.
Create a Folder
53.7.
Challenges
Projects
54.
Journal Entries
55.
Draw a Picture
Code Structure VI
56.
Object
❱
56.1.
Subtypes
56.2.
instanceof
56.3.
toString
56.4.
Override toString
56.5.
@Override
56.6.
equals and hashCode
56.7.
Override equals and hashCode
57.
Generics
❱
57.1.
Type Variables
57.2.
Naming
57.3.
Instantiation
57.4.
Inference
57.5.
Soundness
57.6.
Raw Types
58.
Interfaces
❱
58.1.
Interface Declaration
58.2.
Implementation
58.3.
@Override
58.4.
Naming
58.5.
Subtypes
58.6.
Multiple Implementations
Data Types V
59.
Time
❱
59.1.
Instant
59.2.
Duration
59.3.
LocalDate
59.4.
LocalTime
59.5.
LocalDateTime
59.6.
Time Zones
59.7.
ZonedDateTime
59.8.
OffsetDateTime
59.9.
Date
59.10.
Challenges
60.
ArrayList
❱
60.1.
Ubiquity
60.2.
Add an item
60.3.
Size
60.4.
Get an item
60.5.
Loop over items
60.6.
Set an item
60.7.
Remove an item
61.
HashMap
❱
61.1.
Filing Cabinets
61.2.
Keys and Values
61.3.
Put Items
61.4.
Get Items
61.5.
Hash Functions
61.6.
Hash Collision
61.7.
Hash Distribution
61.8.
Reference Based Identity
61.9.
Value Based Identity
61.10.
Appropriate Keys
61.11.
Ubiquity
Concepts II
62.
Hyrum's Law
❱
62.1.
Authority
62.2.
Validity
62.3.
Emergent Properties
62.4.
Importance
Control Flow V
63.
Switch III
❱
63.1.
break
63.2.
fallthrough
63.3.
return
63.4.
default
63.5.
yield
64.
Recursion
❱
64.1.
Disclaimer
64.2.
Base Case
64.3.
Comparison to Delegation
64.4.
Comparison to Loops
64.5.
Counting Down
64.6.
Accumulators
64.7.
Recurse Over a String
64.8.
Recurse Over an Array
65.
Loops III
❱
65.1.
For-each loops
65.2.
Arrays
65.3.
Iterable and Iterator
65.4.
ArrayList
65.5.
String
65.6.
Concurrent Modifications
65.7.
Inferred Types
Concepts II
66.
Encapsulation
❱
66.1.
Implementation Details
66.2.
Implicit Interfaces
66.3.
Methods
66.4.
Classes
66.5.
Abstraction
66.6.
Coupling
66.7.
Leaky Abstractions
66.8.
Information Hiding
Data Types VI
67.
Collections
❱
67.1.
List
67.2.
Map
67.3.
Set
67.4.
Arrays
67.5.
UnsupportedOperationException
67.6.
Factories
67.7.
Specificity
68.
Multi-Dimensional Arrays
❱
68.1.
Declaration
68.2.
Array Initializers
68.3.
Initialization with new
68.4.
Access Individual Elements
68.5.
Set Individual Elements
68.6.
Initialization with Size
68.7.
Default Values
68.8.
Populate Values
68.9.
Ragged Arrays
Metaprogramming
69.
Reflection
❱
69.1.
Class Objects
69.2.
Get all Fields
69.3.
Get a Field
69.4.
Read from a Field
69.5.
Write to a Field
69.6.
Get all Methods
69.7.
Get a Method
69.8.
Invoke a Method
69.9.
Get a Constructor
69.10.
Get all Constructors
69.11.
Invoke a Constructor
70.
Annotations
❱
70.1.
Declaration
70.2.
Usage
70.3.
Elements
70.4.
Usage with Elements
70.5.
Defaults
70.6.
@Target
70.7.
@Retention
70.8.
Reflective Access
70.9.
@Override
Code Structure VII
71.
Interfaces II
❱
71.1.
Default Methods
71.2.
Interface Extension
71.3.
Static Methods
71.4.
Static Fields
72.
Class Extension
❱
72.1.
Extend a Class
72.2.
Inheritance
72.3.
Override
72.4.
Protected
72.5.
Abstract Classes
72.6.
Abstract Methods
72.7.
Relation to Interfaces
72.8.
Relation to Encapsulation
72.9.
Final Classes
Data Types VII
73.
Niche Numerics
❱
73.1.
byte
73.2.
short
73.3.
long
73.4.
Unsigned Operations
73.5.
float
Projects
74.
Hot Cross Buns
Code Structure VIII
75.
Modules
❱
75.1.
Declaration
75.2.
Restrictions
75.3.
Exports
75.4.
Integrity
75.5.
java.base
75.6.
The Unnamed Module
75.7.
Module Imports
75.8.
Multi-Module Directory Layout
76.
Lambdas
❱
76.1.
Functional Interfaces
76.2.
@FunctionalInterface
76.3.
Lambda Expressions
76.4.
Method References
76.5.
Runnable
76.6.
Function
76.7.
Relation to Checked Exceptions
77.
Streams
❱
77.1.
map
77.2.
filter
77.3.
Collectors
77.4.
toList
77.5.
mapMulti
77.6.
Gatherers
Sharing Code
78.
Compilation
❱
78.1.
javac
78.2.
--release
79.
Packaging
❱
79.1.
jar
79.2.
--main-class
80.
Documentation
❱
80.1.
javadoc
80.2.
Documentation Comments
81.
Distribution
❱
81.1.
jlink
82.
🚧 (More Chapters Planned) 🚧
Light
Rust
Coal
Navy
Ayu
Modern Java
Challenges