1.
Prelude
❱
1.1.
Asking for Help
1.2.
Toy Problems
1.3.
Lies
1.4.
AI
1.5.
Java
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
Code Structure
17.
Methods
❱
17.1.
Declaration
17.2.
Invocation
17.3.
Scope
17.4.
main
17.5.
Challenges
18.
Arguments
❱
18.1.
Declaration
18.2.
Invocation with Arguments
18.3.
Reassignment
18.4.
Final Arguments
18.5.
Aliasing
18.6.
Overloading
18.7.
Inferred Types
18.8.
Challenges
19.
Return Values
❱
19.1.
Declaration
19.2.
Return Statement
19.3.
Exhaustiveness
19.4.
void
19.5.
Return in void methods
19.6.
Conversion
19.7.
Unreachable Statements
19.8.
Challenges
Data Types III
20.
Multi-Dimensional Arrays
❱
20.1.
Declaration
20.2.
Array Initializers
20.3.
Initialization with new
20.4.
Access Individual Elements
20.5.
Set Individual Elements
20.6.
Initialization with Size
20.7.
Default Values
20.8.
Populate Values
20.9.
Ragged Arrays
20.10.
Challenges
Projects
21.
ASCII Art Generator
Data Types IV
22.
null
❱
22.1.
Null as Absence
22.2.
Null as Unknown
22.3.
Checking for null
22.4.
NullPointerException
22.5.
Challenges
23.
Boxed Primitives
❱
23.1.
Integer
23.2.
Double
23.3.
Character
23.4.
Boolean
23.5.
Unboxing Conversion
23.6.
Boxing Conversion
23.7.
Arrays of Boxed Primitives
23.8.
Challenges
24.
Arrays II
❱
24.1.
Initializion with Size
24.2.
Default Values
24.3.
Populate Arrays
24.4.
Challenges
Code Structure II
25.
Classes
❱
25.1.
The meaning of the word Class
25.2.
Class Declaration
25.3.
Naming
25.4.
Instances
25.5.
Fields
25.6.
Field Initialization
25.7.
Field Access
25.8.
Field Default Values
25.9.
Aliasing
25.10.
Return Multiple Values
25.11.
Challenges
26.
Instance Methods
❱
26.1.
Invocation
26.2.
Arguments
26.3.
Field Access
26.4.
Field Updates
26.5.
Derived Values
26.6.
Invoke Other Methods
26.7.
this
26.8.
Disambiguation
26.9.
Clarity
26.10.
Challenges
Projects
27.
Point of Sale System
Data Types V
28.
Enums
❱
28.1.
Declaration
28.2.
Variants
28.3.
Naming
28.4.
Usage
28.5.
Equality
28.6.
Comparison to boolean
28.7.
Challenges
29.
Strings II
❱
29.1.
lowercase
29.2.
UPPERCASE
29.3.
Equality ignoring case
29.4.
Check if empty
29.5.
Check if blank
29.6.
Strip extra whitespace
29.7.
Challenges
Control Flow III
30.
Exceptions
❱
30.1.
throw
30.2.
Messages
30.3.
Stack Traces
30.4.
try/catch
30.5.
Challenges
31.
Switch
❱
31.1.
Case and Default
31.2.
Strings
31.3.
ints
31.4.
Enums
31.5.
Omitted Default
31.6.
Combining Cases
31.7.
null
31.8.
Exhaustiveness
31.9.
Challenges
Interactive Programs II
32.
Standard Input II
❱
32.1.
Reprompting
32.2.
Enums
32.3.
Delayed Assignment
32.4.
Leniency
32.5.
Aggregating Data
32.6.
Challenges
Code Structure III
33.
Constructors
❱
33.1.
Declaration
33.2.
The Default Constructor
33.3.
Arguments
33.4.
Final Fields
33.5.
Invariants
33.6.
Overloads
33.7.
Delegation
33.8.
Challenges
34.
Global Fields
❱
34.1.
Default Values
34.2.
Final Fields
34.3.
Field Access
34.4.
Inferred Types
34.5.
Challenges
Concepts
35.
Code is Read more than Written
❱
35.1.
Meaning
35.2.
Implications
35.3.
Information Density
35.4.
Audience
35.5.
Practice
The Computing Environment
36.
Hardware
❱
36.1.
CPU
36.2.
RAM
36.3.
Hard Drives
36.4.
Motherboard
37.
Operating Systems
❱
37.1.
Personal Computers
37.2.
Servers
37.3.
Mobile Phones
37.4.
Game Consoles
37.5.
Abstractions
37.6.
Defaults
38.
The Terminal
❱
38.1.
Bash
38.2.
Windows Subsystem for Linux
38.3.
Chromebooks and School Computers
38.4.
Commands
38.5.
Directories
38.6.
Listing Files
38.7.
Creating Directories
38.8.
Changing Directories
38.9.
Creating Files
38.10.
Run Java Programs
38.11.
Getting Used to it
Control Flow IV
39.
Exceptions II
❱
39.1.
Checked Exceptions
39.2.
Unchecked Exceptions
39.3.
throws
39.4.
Propagating Exceptions
39.5.
Exception
39.6.
RuntimeException
39.7.
Rethrowing Exceptions
39.8.
main
39.9.
Challenges
40.
Switch II
❱
40.1.
Yield
40.2.
Omitted Yield
40.3.
Exhaustiveness
40.4.
Return a Switch
40.5.
Challenges
Code Structure IV
41.
Multi-File Programs
❱
41.1.
The Sources folder
41.2.
The Main file
41.3.
A Second file
41.4.
File names
41.5.
The Anonymous Main Class
41.6.
Global Fields
41.7.
Challenges
42.
Visibility
❱
42.1.
Private Methods
42.2.
Private Fields
42.3.
Invariants
42.4.
Accessors
42.5.
Getters and Setters
42.6.
Challenges
43.
Static Fields
❱
43.1.
Declaration
43.2.
Initialization
43.3.
Usage
43.4.
Constants
43.5.
Controversy
43.6.
Naming
43.7.
Challenges
44.
Static Methods
❱
44.1.
Declaration
44.2.
Scope
44.3.
Naming
44.4.
Usage
44.5.
Math
44.6.
Factories
44.7.
Challenges
Data Structures & Algorithms
45.
Growable Arrays
❱
45.1.
Concept
45.2.
Simple Implementation
45.3.
Usage
45.4.
Performance Problems
45.5.
Performance Solutions
45.6.
Optimized Implementation
45.7.
Challenges
Interactive Programs II
46.
Command Line Arguments
❱
46.1.
Accessing Arguments
46.2.
Conventions
46.3.
Challenges
Code Structure V
47.
Inner Classes
❱
47.1.
Type
47.2.
Instances
47.3.
New Operator
47.4.
Scope
47.5.
Disambiguation
47.6.
The anonymous main class
47.7.
Static Inner Classes
47.8.
Private Inner Classes
47.9.
Challenges
48.
Packages
❱
48.1.
Declaration
48.2.
Visibility
48.3.
Public Classes
48.4.
Fully Qualified Class Name
48.5.
Import
48.6.
The Default Package
48.7.
The Anonymous Main Class
48.8.
Public Methods
48.9.
Package-Private Methods
48.10.
Public Fields
48.11.
Package-Private Fields
48.12.
The Default Constructor
48.13.
Public Constructors
48.14.
Package-Private Constructors
48.15.
Subpackages
48.16.
Reverse Domain Name Notation
48.17.
Challenges
Data Types VI
49.
Records
❱
49.1.
Declaration
49.2.
The Canonical Constructor
49.3.
Component Accessors
49.4.
Component Accessor Visibility
49.5.
Printing a Record
49.6.
Check for Equality
49.7.
Return Multiple Values
49.8.
Shorthand
49.9.
Challenges
50.
Integers II
❱
50.1.
Integer from a String
50.2.
Integer to a String
50.3.
Base 16 Integer Literals
50.4.
Integer from a Base 16 String
50.5.
Integer to a Base 16 String
50.6.
Underscores in Integer Literals
50.7.
Challenges
Interactive Programs III
51.
Files
❱
51.1.
Paths
51.2.
IOException
51.3.
UncheckedIOException
51.4.
Write to a File
51.5.
Read from a File
51.6.
Create a Folder
51.7.
Challenges
Projects
52.
Data Visualization
Code Structure VI
53.
Object
❱
53.1.
Subtypes
53.2.
instanceof
53.3.
toString
53.4.
Override toString
53.5.
@Override
53.6.
equals and hashCode
53.7.
Override equals and hashCode
53.8.
Challenges
54.
Generics
❱
54.1.
Type Variables
54.2.
Naming
54.3.
Instantiation
54.4.
Inference
54.5.
Soundness
54.6.
Raw Types
54.7.
Challenges
55.
Interfaces
❱
55.1.
Interface Declaration
55.2.
Implementation
55.3.
@Override
55.4.
Naming
55.5.
Subtypes
55.6.
Multiple Implementations
55.7.
Challenges
Data Types VII
56.
Time
❱
56.1.
Instant
56.2.
Duration
56.3.
LocalDate
56.4.
LocalTime
56.5.
LocalDateTime
56.6.
Time Zones
56.7.
ZonedDateTime
56.8.
OffsetDateTime
56.9.
Date
56.10.
Challenges
57.
ArrayList
❱
57.1.
Ubiquity
57.2.
Add an item
57.3.
Size
57.4.
Get an item
57.5.
Loop over items
57.6.
Set an item
57.7.
Remove an item
57.8.
Challenges
58.
HashMap
❱
58.1.
Filing Cabinets
58.2.
Keys and Values
58.3.
Put Items
58.4.
Get Items
58.5.
Hash Functions
58.6.
Hash Collision
58.7.
Hash Distribution
58.8.
Reference Based Identity
58.9.
Value Based Identity
58.10.
Appropriate Keys
58.11.
Ubiquity
58.12.
Challenges
Concepts II
59.
Hyrum's Law
❱
59.1.
Authority
59.2.
Validity
59.3.
Emergent Properties
59.4.
Importance
Control Flow V
60.
Switch III
❱
60.1.
break
60.2.
fallthrough
60.3.
return
60.4.
default
60.5.
yield
60.6.
Challenges
61.
Recursion
❱
61.1.
Disclaimer
61.2.
Base Case
61.3.
Comparison to Delegation
61.4.
Comparison to Loops
61.5.
Counting Down
61.6.
Accumulators
61.7.
Recurse Over a String
61.8.
Recurse Over an Array
61.9.
Challenges
62.
Loops III
❱
62.1.
For-each loops
62.2.
Arrays
62.3.
Iterable and Iterator
62.4.
ArrayList
62.5.
String
62.6.
Concurrent Modifications
62.7.
Inferred Types
62.8.
Challenges
Concepts II
63.
Encapsulation
❱
63.1.
Implementation Details
63.2.
Implicit Interfaces
63.3.
Methods
63.4.
Classes
63.5.
Abstraction
63.6.
Coupling
63.7.
Leaky Abstractions
63.8.
Information Hiding
Data Types VIII
64.
Collections
❱
64.1.
List
64.2.
Map
64.3.
Set
64.4.
Arrays
64.5.
UnsupportedOperationException
64.6.
Factories
64.7.
Specificity
64.8.
Challenges
Metaprogramming
65.
Reflection
❱
65.1.
Class Objects
65.2.
Get all Fields
65.3.
Get a Field
65.4.
Read from a Field
65.5.
Write to a Field
65.6.
Get all Methods
65.7.
Get a Method
65.8.
Invoke a Method
65.9.
Get a Constructor
65.10.
Get all Constructors
65.11.
Invoke a Constructor
65.12.
Challenges
66.
Annotations
❱
66.1.
Declaration
66.2.
Usage
66.3.
Elements
66.4.
Usage with Elements
66.5.
Defaults
66.6.
@Target
66.7.
@Retention
66.8.
Reflective Access
66.9.
@Override
66.10.
Challenges
Code Structure VII
67.
Interfaces II
❱
67.1.
Default Methods
67.2.
Interface Extension
67.3.
Static Methods
67.4.
Static Fields
67.5.
Challenges
68.
Class Extension
❱
68.1.
Extend a Class
68.2.
Inheritance
68.3.
Override
68.4.
Protected
68.5.
Abstract Classes
68.6.
Abstract Methods
68.7.
Relation to Interfaces
68.8.
Relation to Encapsulation
68.9.
Final Classes
68.10.
Challenges
Data Types IX
69.
Niche Numerics
❱
69.1.
byte
69.2.
short
69.3.
long
69.4.
Unsigned Operations
69.5.
float
69.6.
Challenges
Projects
70.
Hot Cross Buns
Code Structure VIII
71.
Modules
❱
71.1.
Declaration
71.2.
Restrictions
71.3.
Exports
71.4.
Integrity
71.5.
java.base
71.6.
The Unnamed Module
71.7.
Module Imports
71.8.
Multi-Module Directory Layout
72.
Lambdas
❱
72.1.
Functional Interfaces
72.2.
@FunctionalInterface
72.3.
Lambda Expressions
72.4.
Method References
72.5.
Runnable
72.6.
Function
72.7.
Relation to Checked Exceptions
73.
Streams
❱
73.1.
map
73.2.
filter
73.3.
Collectors
73.4.
toList
73.5.
mapMulti
73.6.
Gatherers
Sharing Code
74.
Compilation
❱
74.1.
javac
74.2.
Class Files
74.3.
Modules
74.4.
Compile Multiple Files
74.5.
Clean
74.6.
-g
74.7.
Running Compiled Code
74.8.
Challenges
75.
Packaging
❱
75.1.
jar
75.2.
Jar Files
75.3.
--module-path
75.4.
--main-class
75.5.
Libraries
75.6.
Challenges
Tools
76.
just
❱
76.1.
Installation
76.2.
Justfile
76.3.
Recipes
76.4.
Dependencies
76.5.
Documentation Comments
76.6.
Further Reading
76.7.
Challenges
Sharing Code II
77.
Documentation
❱
77.1.
Documentation Comments
77.2.
Format
77.3.
javadoc
77.4.
Challenges
78.
🚧 (More Chapters Planned) 🚧
Light
Rust
Coal
Navy
Ayu
Modern Java
Lambdas