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
Projects
17.
ASCII Art Generator
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
Data Types III
21.
null
❱
21.1.
Null as Absence
21.2.
Null as Unknown
21.3.
Checking for null
21.4.
NullPointerException
21.5.
Challenges
22.
Boxed Primitives
❱
22.1.
Integer
22.2.
Double
22.3.
Character
22.4.
Boolean
22.5.
Unboxing Conversion
22.6.
Boxing Conversion
22.7.
Arrays of Boxed Primitives
22.8.
Challenges
23.
Arrays II
❱
23.1.
Initializion with Size
23.2.
Default Values
23.3.
Populate Arrays
23.4.
Challenges
Code Structure II
24.
Classes
❱
24.1.
The meaning of the word Class
24.2.
Class Declaration
24.3.
Naming
24.4.
Instances
24.5.
Fields
24.6.
Field Initialization
24.7.
Field Access
24.8.
Field Default Values
24.9.
Aliasing
24.10.
Return Multiple Values
24.11.
Challenges
25.
Instance Methods
❱
25.1.
Invocation
25.2.
Arguments
25.3.
Field Access
25.4.
Field Updates
25.5.
Derived Values
25.6.
Invoke Other Methods
25.7.
this
25.8.
Disambiguation
25.9.
Clarity
25.10.
Challenges
Projects
26.
Point of Sale System
Data Types IV
27.
Enums
❱
27.1.
Declaration
27.2.
Variants
27.3.
Naming
27.4.
Usage
27.5.
Equality
27.6.
Comparison to boolean
27.7.
Challenges
28.
Strings II
❱
28.1.
lowercase
28.2.
UPPERCASE
28.3.
Equality ignoring case
28.4.
Check if empty
28.5.
Check if blank
28.6.
Strip extra whitespace
28.7.
Challenges
Control Flow III
29.
Exceptions
❱
29.1.
throw
29.2.
Messages
29.3.
Stack Traces
29.4.
try/catch
29.5.
Challenges
30.
Switch
❱
30.1.
Case and Default
30.2.
Strings
30.3.
ints
30.4.
Enums
30.5.
Omitted Default
30.6.
Combining Cases
30.7.
null
30.8.
Exhaustiveness
30.9.
Challenges
Interactive Programs II
31.
Standard Input II
❱
31.1.
Reprompting
31.2.
Enums
31.3.
Delayed Assignment
31.4.
Leniency
31.5.
Aggregating Data
31.6.
Challenges
Code Structure III
32.
Constructors
❱
32.1.
Declaration
32.2.
The Default Constructor
32.3.
Arguments
32.4.
Final Fields
32.5.
Invariants
32.6.
Overloads
32.7.
Delegation
32.8.
Challenges
33.
Global Fields
❱
33.1.
Default Values
33.2.
Final Fields
33.3.
Field Access
33.4.
Inferred Types
33.5.
Challenges
Concepts
34.
Code is Read more than Written
❱
34.1.
Meaning
34.2.
Implications
34.3.
Information Density
34.4.
Audience
34.5.
Practice
The Computing Environment
35.
Hardware
❱
35.1.
CPU
35.2.
RAM
35.3.
Hard Drives
35.4.
Motherboard
36.
Operating Systems
❱
36.1.
Personal Computers
36.2.
Servers
36.3.
Mobile Phones
36.4.
Game Consoles
36.5.
Abstractions
36.6.
Defaults
37.
The Terminal
❱
37.1.
Bash
37.2.
Windows Subsystem for Linux
37.3.
Chromebooks and School Computers
37.4.
Commands
37.5.
Directories
37.6.
Listing Files
37.7.
Creating Directories
37.8.
Changing Directories
37.9.
Creating Files
37.10.
Run Java Programs
37.11.
Getting Used to it
Control Flow IV
38.
Exceptions II
❱
38.1.
Checked Exceptions
38.2.
Unchecked Exceptions
38.3.
throws
38.4.
Propagating Exceptions
38.5.
Exception
38.6.
RuntimeException
38.7.
Rethrowing Exceptions
38.8.
main
38.9.
Challenges
39.
Switch II
❱
39.1.
Yield
39.2.
Omitted Yield
39.3.
Exhaustiveness
39.4.
Return a Switch
39.5.
Challenges
Code Structure IV
40.
Multi-File Programs
❱
40.1.
The Sources folder
40.2.
The Main file
40.3.
A Second file
40.4.
File names
40.5.
The Anonymous Main Class
40.6.
Global Fields
40.7.
Challenges
41.
Visibility
❱
41.1.
Private Methods
41.2.
Private Fields
41.3.
Invariants
41.4.
Accessors
41.5.
Getters and Setters
41.6.
Challenges
42.
Static Fields
❱
42.1.
Declaration
42.2.
Initialization
42.3.
Usage
42.4.
Constants
42.5.
Controversy
42.6.
Naming
42.7.
Challenges
43.
Static Methods
❱
43.1.
Declaration
43.2.
Scope
43.3.
Naming
43.4.
Usage
43.5.
Math
43.6.
Factories
43.7.
Challenges
Data Structures & Algorithms
44.
Growable Arrays
❱
44.1.
Concept
44.2.
Simple Implementation
44.3.
Usage
44.4.
Performance Problems
44.5.
Performance Solutions
44.6.
Optimized Implementation
44.7.
Challenges
Interactive Programs II
45.
Command Line Arguments
❱
45.1.
Accessing Arguments
45.2.
Conventions
45.3.
Challenges
Code Structure V
46.
Inner Classes
❱
46.1.
Type
46.2.
Instances
46.3.
New Operator
46.4.
Scope
46.5.
Disambiguation
46.6.
The anonymous main class
46.7.
Static Inner Classes
46.8.
Private Inner Classes
46.9.
Challenges
47.
Packages
❱
47.1.
Declaration
47.2.
Visibility
47.3.
Public Classes
47.4.
Fully Qualified Class Name
47.5.
Import
47.6.
The Default Package
47.7.
The Anonymous Main Class
47.8.
Public Methods
47.9.
Package-Private Methods
47.10.
Public Fields
47.11.
Package-Private Fields
47.12.
The Default Constructor
47.13.
Public Constructors
47.14.
Package-Private Constructors
47.15.
Subpackages
47.16.
Reverse Domain Name Notation
47.17.
Challenges
Data Types IV
48.
Records
❱
48.1.
Declaration
48.2.
The Canonical Constructor
48.3.
Component Accessors
48.4.
Component Accessor Visibility
48.5.
Printing a Record
48.6.
Check for Equality
48.7.
Return Multiple Values
48.8.
Shorthand
48.9.
Challenges
49.
Integers II
❱
49.1.
Integer from a String
49.2.
Integer to a String
49.3.
Base 16 Integer Literals
49.4.
Integer from a Base 16 String
49.5.
Integer to a Base 16 String
49.6.
Underscores in Integer Literals
49.7.
Challenges
Interactive Programs III
50.
Files
❱
50.1.
Paths
50.2.
IOException
50.3.
UncheckedIOException
50.4.
Write to a File
50.5.
Read from a File
50.6.
Create a Folder
50.7.
Challenges
Projects
51.
Data Visualization
Code Structure VI
52.
Object
❱
52.1.
Subtypes
52.2.
instanceof
52.3.
toString
52.4.
Override toString
52.5.
@Override
52.6.
equals and hashCode
52.7.
Override equals and hashCode
52.8.
Challenges
53.
Generics
❱
53.1.
Type Variables
53.2.
Naming
53.3.
Instantiation
53.4.
Inference
53.5.
Soundness
53.6.
Raw Types
53.7.
Challenges
54.
Interfaces
❱
54.1.
Interface Declaration
54.2.
Implementation
54.3.
@Override
54.4.
Naming
54.5.
Subtypes
54.6.
Multiple Implementations
54.7.
Challenges
Data Types V
55.
Time
❱
55.1.
Instant
55.2.
Duration
55.3.
LocalDate
55.4.
LocalTime
55.5.
LocalDateTime
55.6.
Time Zones
55.7.
ZonedDateTime
55.8.
OffsetDateTime
55.9.
Date
55.10.
Challenges
56.
ArrayList
❱
56.1.
Ubiquity
56.2.
Add an item
56.3.
Size
56.4.
Get an item
56.5.
Loop over items
56.6.
Set an item
56.7.
Remove an item
56.8.
Challenges
57.
HashMap
❱
57.1.
Filing Cabinets
57.2.
Keys and Values
57.3.
Put Items
57.4.
Get Items
57.5.
Hash Functions
57.6.
Hash Collision
57.7.
Hash Distribution
57.8.
Reference Based Identity
57.9.
Value Based Identity
57.10.
Appropriate Keys
57.11.
Ubiquity
57.12.
Challenges
Concepts II
58.
Hyrum's Law
❱
58.1.
Authority
58.2.
Validity
58.3.
Emergent Properties
58.4.
Importance
Control Flow V
59.
Switch III
❱
59.1.
break
59.2.
fallthrough
59.3.
return
59.4.
default
59.5.
yield
60.
Recursion
❱
60.1.
Disclaimer
60.2.
Base Case
60.3.
Comparison to Delegation
60.4.
Comparison to Loops
60.5.
Counting Down
60.6.
Accumulators
60.7.
Recurse Over a String
60.8.
Recurse Over an Array
61.
Loops III
❱
61.1.
For-each loops
61.2.
Arrays
61.3.
Iterable and Iterator
61.4.
ArrayList
61.5.
String
61.6.
Concurrent Modifications
61.7.
Inferred Types
Concepts II
62.
Encapsulation
❱
62.1.
Implementation Details
62.2.
Implicit Interfaces
62.3.
Methods
62.4.
Classes
62.5.
Abstraction
62.6.
Coupling
62.7.
Leaky Abstractions
62.8.
Information Hiding
Data Types VI
63.
Collections
❱
63.1.
List
63.2.
Map
63.3.
Set
63.4.
Arrays
63.5.
UnsupportedOperationException
63.6.
Factories
63.7.
Specificity
64.
Multi-Dimensional Arrays
❱
64.1.
Declaration
64.2.
Array Initializers
64.3.
Initialization with new
64.4.
Access Individual Elements
64.5.
Set Individual Elements
64.6.
Initialization with Size
64.7.
Default Values
64.8.
Populate Values
64.9.
Ragged Arrays
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
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
Code Structure VII
67.
Interfaces II
❱
67.1.
Default Methods
67.2.
Interface Extension
67.3.
Static Methods
67.4.
Static Fields
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
Data Types VII
69.
Niche Numerics
❱
69.1.
byte
69.2.
short
69.3.
long
69.4.
Unsigned Operations
69.5.
float
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.
--release
75.
Packaging
❱
75.1.
jar
75.2.
--main-class
76.
Documentation
❱
76.1.
javadoc
76.2.
Documentation Comments
77.
Distribution
❱
77.1.
jlink
78.
🚧 (More Chapters Planned) 🚧
Light
Rust
Coal
Navy
Ayu
Modern Java
Java