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
Interactive Programs II
13.
Standard Input II
❱
13.1.
Prompting
13.2.
Interpreting Input
13.3.
Reprompting
13.4.
Leniency
13.5.
Delayed Assignment
Projects
14.
Prelude
15.
Calorie Tracker
Data Types II
16.
Arrays
❱
16.1.
Array Initializers
16.2.
Length
16.3.
Access Individual Elements
16.4.
Set Individual Elements
16.5.
Aliasing
16.6.
Reassignment
16.7.
Relation to Final Variables
16.8.
Printing the Contents of an Array
16.9.
Empty Array
16.10.
Difference between Initializer and Literal
16.11.
Initialization with new
16.12.
Challenges
Control Flow II
17.
Loops II
❱
17.1.
For
17.2.
For Syntax
17.3.
Counting Up and Down
17.4.
Iterate over a String
17.5.
Iterate over an Array
17.6.
Comparison to while
17.7.
i
17.8.
Break
17.9.
Continue
17.10.
Delayed Assignment
17.11.
Inferred Types
17.12.
Empty Initializers
17.13.
Empty Expressions
17.14.
Empty Statements
17.15.
Final Variables
17.16.
Labeled Break
17.17.
Labeled Continue
17.18.
Drawing Right Triangles
17.19.
Drawing Isosceles Triangles
17.20.
Challenges
Projects
18.
ASCII Art Generator
Code Structure
19.
Methods
❱
19.1.
Declaration
19.2.
Invocation
19.3.
Scope
19.4.
main
19.5.
Challenges
20.
Arguments
❱
20.1.
Declaration
20.2.
Invocation with Arguments
20.3.
Reassignment
20.4.
Final Arguments
20.5.
Aliasing
20.6.
Overloading
20.7.
Inferred Types
20.8.
Challenges
21.
Return Values
❱
21.1.
Declaration
21.2.
Return Statement
21.3.
Exhaustiveness
21.4.
void
21.5.
Return in void methods
21.6.
Conversion
21.7.
Unreachable Statements
21.8.
Challenges
Data Types III
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
Projects
25.
Point of Sale System
Code Structure II
26.
Classes
❱
26.1.
The meaning of the word Class
26.2.
Class Declaration
26.3.
Naming
26.4.
Instances
26.5.
Fields
26.6.
Field Initialization
26.7.
Field Access
26.8.
Field Default Values
26.9.
Aliasing
26.10.
Return Multiple Values
26.11.
Challenges
27.
Instance Methods
❱
27.1.
Invocation
27.2.
Arguments
27.3.
Field Access
27.4.
Field Updates
27.5.
Derived Values
27.6.
Invoke Other Methods
27.7.
this
27.8.
Disambiguation
27.9.
Clarity
27.10.
Challenges
Interactive Programs III
28.
Standard Input III
❱
28.1.
Transporting Data
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
The Computing Environment
37.
Hardware
❱
37.1.
CPU
37.2.
RAM
37.3.
Hard Drives
37.4.
Motherboard
38.
Operating Systems
❱
38.1.
Personal Computers
38.2.
Servers
38.3.
Mobile Phones
38.4.
Game Consoles
38.5.
Abstractions
38.6.
Defaults
39.
The Terminal
❱
39.1.
Bash
39.2.
Windows Subsystem for Linux
39.3.
Chromebooks and School Computers
39.4.
Commands
39.5.
Directories
39.6.
Listing Files
39.7.
Creating Directories
39.8.
Changing Directories
39.9.
Creating Files
39.10.
Run Java Programs
39.11.
Getting Used to it
Control Flow IV
40.
Exceptions II
❱
40.1.
Checked Exceptions
40.2.
Unchecked Exceptions
40.3.
throws
40.4.
Propagating Exceptions
40.5.
Rethrowing Exceptions
40.6.
Exception
40.7.
RuntimeException
40.8.
main
41.
Switch II
❱
41.1.
Yield
41.2.
Omitted Yield
41.3.
Exhaustiveness
41.4.
Return a Switch
Code Structure IV
42.
Multi-File Programs
❱
42.1.
The Sources folder
42.2.
The Main file
42.3.
A Second file
42.4.
File names
42.5.
The Anonymous Main Class
42.6.
Global Fields
43.
Visibility
❱
43.1.
Private Methods
43.2.
Private Fields
43.3.
Invariants
43.4.
Accessors
43.5.
Getters and Setters
44.
Static Fields
❱
44.1.
Declaration
44.2.
Initialization
44.3.
Usage
44.4.
Constants
44.5.
Controversy
44.6.
Naming
45.
Static Methods
❱
45.1.
Declaration
45.2.
Scope
45.3.
Naming
45.4.
Usage
45.5.
Math
45.6.
Factories
Data Structures & Algorithms
46.
Growable Arrays
❱
46.1.
Concept
46.2.
Simple Implementation
46.3.
Usage
46.4.
Performance Problems
46.5.
Performance Solutions
46.6.
Optimized Implementation
Interactive Programs II
47.
Command Line Arguments
❱
47.1.
Accessing Arguments
47.2.
Conventions
Code Structure V
48.
Inner Classes
❱
48.1.
Type
48.2.
Instances
48.3.
New Operator
48.4.
Scope
48.5.
Disambiguation
48.6.
The anonymous main class
48.7.
Static Inner Classes
48.8.
Private Inner Classes
49.
Packages
❱
49.1.
Declaration
49.2.
Visibility
49.3.
Public Classes
49.4.
Fully Qualified Class Name
49.5.
Import
49.6.
The Default Package
49.7.
The Anonymous Main Class
49.8.
Public Methods
49.9.
Package-Private Methods
49.10.
Public Fields
49.11.
Package-Private Fields
49.12.
The Default Constructor
49.13.
Public Constructors
49.14.
Package-Private Constructors
49.15.
Subpackages
49.16.
Reverse Domain Name Notation
Data Types IV
50.
Records
❱
50.1.
Declaration
50.2.
The Canonical Constructor
50.3.
Component Accessors
50.4.
Component Accessor Visibility
50.5.
Printing a Record
50.6.
Check for Equality
50.7.
Return Multiple Values
50.8.
Shorthand
51.
Integers II
❱
51.1.
Integer from a String
51.2.
Integer to a String
51.3.
Base 16 Integer Literals
51.4.
Integer from a Base 16 String
51.5.
Integer to a Base 16 String
51.6.
Underscores in Integer Literals
Interactive Programs III
52.
Files
❱
52.1.
Paths
52.2.
IOException
52.3.
UncheckedIOException
52.4.
Write to a File
52.5.
Read from a File
52.6.
Create a Folder
52.7.
Challenges
Projects
53.
Journal Entries
54.
Draw a Picture
Code Structure VI
55.
Object
❱
55.1.
Subtypes
55.2.
instanceof
55.3.
toString
55.4.
Override toString
55.5.
@Override
55.6.
equals and hashCode
55.7.
Override equals and hashCode
56.
Generics
❱
56.1.
Type Variables
56.2.
Naming
56.3.
Instantiation
56.4.
Inference
56.5.
Soundness
56.6.
Raw Types
57.
Interfaces
❱
57.1.
Interface Declaration
57.2.
Implementation
57.3.
@Override
57.4.
Naming
57.5.
Subtypes
57.6.
Multiple Implementations
Data Types V
58.
Time
❱
58.1.
Instant
58.2.
Duration
58.3.
LocalDate
58.4.
LocalTime
58.5.
LocalDateTime
58.6.
Time Zones
58.7.
ZonedDateTime
58.8.
OffsetDateTime
58.9.
Date
58.10.
Challenges
59.
ArrayList
❱
59.1.
Ubiquity
59.2.
Add an item
59.3.
Size
59.4.
Get an item
59.5.
Loop over items
59.6.
Set an item
59.7.
Remove an item
60.
HashMap
❱
60.1.
Filing Cabinets
60.2.
Keys and Values
60.3.
Put Items
60.4.
Get Items
60.5.
Hash Functions
60.6.
Hash Collision
60.7.
Hash Distribution
60.8.
Reference Based Identity
60.9.
Value Based Identity
60.10.
Appropriate Keys
60.11.
Ubiquity
Concepts II
61.
Hyrum's Law
❱
61.1.
Authority
61.2.
Validity
61.3.
Emergent Properties
61.4.
Importance
Control Flow V
62.
Switch III
❱
62.1.
break
62.2.
fallthrough
62.3.
return
62.4.
default
62.5.
yield
63.
Recursion
❱
63.1.
Disclaimer
63.2.
Base Case
63.3.
Comparison to Delegation
63.4.
Comparison to Loops
63.5.
Counting Down
63.6.
Accumulators
63.7.
Recurse Over a String
63.8.
Recurse Over an Array
64.
Loops III
❱
64.1.
For-each loops
64.2.
Arrays
64.3.
Iterable and Iterator
64.4.
ArrayList
64.5.
String
64.6.
Concurrent Modifications
64.7.
Inferred Types
Concepts II
65.
Encapsulation
❱
65.1.
Implementation Details
65.2.
Implicit Interfaces
65.3.
Methods
65.4.
Classes
65.5.
Abstraction
65.6.
Coupling
65.7.
Leaky Abstractions
65.8.
Information Hiding
Data Types VI
66.
Collections
❱
66.1.
List
66.2.
Map
66.3.
Set
66.4.
Arrays
66.5.
UnsupportedOperationException
66.6.
Factories
66.7.
Specificity
67.
Multi-Dimensional Arrays
❱
67.1.
Declaration
67.2.
Array Initializers
67.3.
Initialization with new
67.4.
Access Individual Elements
67.5.
Set Individual Elements
67.6.
Initialization with Size
67.7.
Default Values
67.8.
Populate Values
67.9.
Ragged Arrays
Metaprogramming
68.
Reflection
❱
68.1.
Class Objects
68.2.
Get all Fields
68.3.
Get a Field
68.4.
Read from a Field
68.5.
Write to a Field
68.6.
Get all Methods
68.7.
Get a Method
68.8.
Invoke a Method
68.9.
Get a Constructor
68.10.
Get all Constructors
68.11.
Invoke a Constructor
69.
Annotations
❱
69.1.
Declaration
69.2.
Usage
69.3.
Elements
69.4.
Usage with Elements
69.5.
Defaults
69.6.
@Target
69.7.
@Retention
69.8.
Reflective Access
69.9.
@Override
Code Structure VII
70.
Interfaces II
❱
70.1.
Default Methods
70.2.
Interface Extension
70.3.
Static Methods
70.4.
Static Fields
71.
Class Extension
❱
71.1.
Extend a Class
71.2.
Inheritance
71.3.
Override
71.4.
Protected
71.5.
Abstract Classes
71.6.
Abstract Methods
71.7.
Relation to Interfaces
71.8.
Relation to Encapsulation
71.9.
Final Classes
Data Types VII
72.
Niche Numerics
❱
72.1.
byte
72.2.
short
72.3.
long
72.4.
Unsigned Operations
72.5.
float
Projects
73.
Hot Cross Buns
Code Structure VIII
74.
Modules
❱
74.1.
Declaration
74.2.
Restrictions
74.3.
Exports
74.4.
Integrity
74.5.
java.base
74.6.
The Unnamed Module
74.7.
Module Imports
74.8.
Multi-Module Directory Layout
75.
Lambdas
❱
75.1.
Functional Interfaces
75.2.
@FunctionalInterface
75.3.
Lambda Expressions
75.4.
Method References
75.5.
Runnable
75.6.
Function
75.7.
Relation to Checked Exceptions
76.
Streams
❱
76.1.
map
76.2.
filter
76.3.
Collectors
76.4.
toList
76.5.
mapMulti
76.6.
Gatherers
Sharing Code
77.
Compilation
❱
77.1.
javac
77.2.
--release
78.
Packaging
❱
78.1.
jar
78.2.
--main-class
79.
Documentation
❱
79.1.
javadoc
79.2.
Documentation Comments
80.
Distribution
❱
80.1.
jlink
81.
🚧 (More Chapters Planned) 🚧
Light
Rust
Coal
Navy
Ayu
Modern Java
Standard Input III