1.
Prelude
❱
1.1.
Asking for Help
1.2.
Toy Problems
1.3.
Lies
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
Control Flow I
10.
Branching Paths
❱
10.1.
If
10.2.
Nested Ifs
10.3.
Else
10.4.
Else If
10.5.
Relation to Delayed Assignment
10.6.
Scoped Variables
10.7.
Conditional Operator
10.8.
Boolean Expressions
10.9.
Challenges
11.
Loops
❱
11.1.
While
11.2.
Endless Loops
11.3.
Break
11.4.
Continue
11.5.
Unreachable Code
11.6.
Do While
11.7.
Nested Loops
11.8.
Labeled Break
11.9.
Labeled Continue
11.10.
Iteration
11.11.
Counting Up
11.12.
Counting Down
11.13.
Iterate over a String
11.14.
Challenges
Data Types II
12.
Arrays
❱
12.1.
Array Initializers
12.2.
Length
12.3.
Access Individual Elements
12.4.
Set Individual Elements
12.5.
Aliasing
12.6.
Reassignment
12.7.
Relation to Final Variables
12.8.
Printing the Contents of an Array
12.9.
Empty Array
12.10.
Difference between Initializer and Literal
12.11.
Initialization with new
12.12.
Challenges
Projects
13.
The Boston Molasses Disaster Game
Control Flow II
14.
Loops II
❱
14.1.
For
14.2.
For Syntax
14.3.
Counting Up and Down
14.4.
Iterate over a String
14.5.
Iterate over an Array
14.6.
Comparison to while
14.7.
i
14.8.
Break
14.9.
Continue
14.10.
Delayed Assignment
14.11.
Inferred Types
14.12.
Empty Initializers
14.13.
Empty Expressions
14.14.
Empty Statements
14.15.
Final Variables
14.16.
Labeled Break
14.17.
Labeled Continue
14.18.
Drawing Right Triangles
14.19.
Drawing Isosceles Triangles
14.20.
Challenges
Code Structure
15.
Methods
❱
15.1.
Declaration
15.2.
Invocation
15.3.
Scope
15.4.
main
15.5.
Challenges
16.
Arguments
❱
16.1.
Declaration
16.2.
Invocation with Arguments
16.3.
Reassignment
16.4.
Final Arguments
16.5.
Aliasing
16.6.
Overloading
16.7.
Inferred Types
16.8.
Challenges
17.
Return Values
❱
17.1.
Declaration
17.2.
Return Statement
17.3.
Exhaustiveness
17.4.
void
17.5.
Return in void methods
17.6.
Conversion
17.7.
Unreachable Statements
17.8.
Challenges
Projects
18.
Tic-Tac-Toe
Data Types III
19.
null
❱
19.1.
Null as Absence
19.2.
Null as Unknown
19.3.
Checking for null
19.4.
NullPointerException
19.5.
Challenges
20.
Boxed Primitives
❱
20.1.
Integer
20.2.
Double
20.3.
Character
20.4.
Boolean
20.5.
Unboxing Conversion
20.6.
Boxing Conversion
20.7.
Arrays of Boxed Primitives
20.8.
Challenges
21.
Arrays II
❱
21.1.
Initializion with Size
21.2.
Default Values
21.3.
Populate Arrays
21.4.
Challenges
Projects II
22.
Ultimate Tic-Tac-Toe
Code Structure II
23.
Classes
❱
23.1.
The meaning of the word Class
23.2.
Class Declaration
23.3.
Naming
23.4.
Instances
23.5.
Fields
23.6.
Field Initialization
23.7.
Field Access
23.8.
Field Default Values
23.9.
Aliasing
23.10.
Return Multiple Values
23.11.
Challenges
24.
Instance Methods
❱
24.1.
Invocation
24.2.
Arguments
24.3.
Field Access
24.4.
Field Updates
24.5.
Derived Values
24.6.
Invoke Other Methods
24.7.
this
24.8.
Disambiguation
24.9.
Clarity
24.10.
Challenges
Data Types IV
25.
Enums
❱
25.1.
Declaration
25.2.
Variants
25.3.
Naming
25.4.
Usage
25.5.
Equality
25.6.
Comparison to boolean
25.7.
Challenges
26.
Strings II
❱
26.1.
lowercase
26.2.
UPPERCASE
26.3.
Equality ignoring case
26.4.
Check if empty
26.5.
Check if blank
26.6.
Strip extra whitespace
26.7.
Challenges
Control Flow III
27.
Exceptions
❱
27.1.
throw
27.2.
Messages
27.3.
Stack Traces
27.4.
try/catch
27.5.
Challenges
28.
Switch
❱
28.1.
Case and Default
28.2.
Strings
28.3.
ints
28.4.
Enums
28.5.
Omitted Default
28.6.
Exhaustiveness
28.7.
Combining Cases
28.8.
null
28.9.
Challenges
Code Structure III
29.
Constructors
❱
29.1.
Declaration
29.2.
The Default Constructor
29.3.
Arguments
29.4.
Final Fields
29.5.
Invariants
29.6.
Overloads
29.7.
Delegation
29.8.
Challenges
30.
Global Fields
❱
30.1.
Default Values
30.2.
Final Fields
30.3.
Field Access
30.4.
Inferred Types
30.5.
Challenges
Concepts
31.
Code is Read more than Written
❱
31.1.
Meaning
31.2.
Implications
31.3.
Information Density
31.4.
Audience
31.5.
Practice
Interactive Programs
32.
Standard Input
❱
32.1.
Prompting
32.2.
Interpreting Input
32.3.
Reprompting
32.4.
Leniency
32.5.
Delayed Assignment
32.6.
Transporting Data
The Computing Environment
33.
Hardware
❱
33.1.
CPU
33.2.
RAM
33.3.
Hard Drives
33.4.
Motherboard
34.
Operating Systems
❱
34.1.
Personal Computers
34.2.
Servers
34.3.
Mobile Phones
34.4.
Game Consoles
34.5.
Abstractions
34.6.
Defaults
35.
The Terminal
❱
35.1.
Bash
35.2.
Windows Subsystem for Linux
35.3.
Chromebooks and School Computers
35.4.
Commands
35.5.
Directories
35.6.
Listing Files
35.7.
Creating Directories
35.8.
Changing Directories
35.9.
Creating Files
35.10.
Run Java Programs
35.11.
Getting Used to it
Control Flow IV
36.
Exceptions II
❱
36.1.
Checked Exceptions
36.2.
Unchecked Exceptions
36.3.
throws
36.4.
Propagating Exceptions
36.5.
Rethrowing Exceptions
36.6.
Exception
36.7.
RuntimeException
36.8.
main
37.
Switch II
❱
37.1.
Yield
37.2.
Omitted Yield
37.3.
Exhaustiveness
37.4.
Return a Switch
Code Structure IV
38.
Multi-File Programs
❱
38.1.
The Sources folder
38.2.
The Main file
38.3.
A Second file
38.4.
File names
38.5.
The Anonymous Main Class
38.6.
Global Fields
39.
Visibility
❱
39.1.
Private Methods
39.2.
Private Fields
39.3.
Invariants
39.4.
Accessors
39.5.
Getters and Setters
40.
Static Fields
❱
40.1.
Declaration
40.2.
Initialization
40.3.
Usage
40.4.
Constants
40.5.
Controversy
40.6.
Naming
41.
Static Methods
❱
41.1.
Declaration
41.2.
Scope
41.3.
Naming
41.4.
Usage
41.5.
Math
41.6.
Factories
Data Structures & Algorithms
42.
Growable Arrays
❱
42.1.
Concept
42.2.
Simple Implementation
42.3.
Usage
42.4.
Performance Problems
42.5.
Performance Solutions
42.6.
Optimized Implementation
Interactive Programs II
43.
Command Line Arguments
❱
43.1.
Accessing Arguments
43.2.
Conventions
Code Structure V
44.
Inner Classes
❱
44.1.
Type
44.2.
Instances
44.3.
New Operator
44.4.
Scope
44.5.
Disambiguation
44.6.
The anonymous main class
44.7.
Static Inner Classes
44.8.
Private Inner Classes
45.
Packages
❱
45.1.
Declaration
45.2.
Visibility
45.3.
Public Classes
45.4.
Fully Qualified Class Name
45.5.
Import
45.6.
The Default Package
45.7.
The Anonymous Main Class
45.8.
Public Methods
45.9.
Package-Private Methods
45.10.
Public Fields
45.11.
Package-Private Fields
45.12.
The Default Constructor
45.13.
Public Constructors
45.14.
Package-Private Constructors
45.15.
Subpackages
45.16.
Reverse Domain Name Notation
Data Types IV
46.
Records
❱
46.1.
Declaration
46.2.
The Canonical Constructor
46.3.
Component Accessors
46.4.
Component Accessor Visibility
46.5.
Printing a Record
46.6.
Check for Equality
46.7.
Return Multiple Values
46.8.
Shorthand
47.
Integers II
❱
47.1.
Integer from a String
47.2.
Integer to a String
47.3.
Base 16 Integer Literals
47.4.
Integer from a Base 16 String
47.5.
Integer to a Base 16 String
47.6.
Underscores in Integer Literals
Interactive Programs III
48.
Files
❱
48.1.
Paths
48.2.
IOException
48.3.
UncheckedIOException
48.4.
Write to a File
48.5.
Read from a File
48.6.
Create a Folder
48.7.
Challenges
Code Structure VI
49.
Object
❱
49.1.
Subtypes
49.2.
instanceof
49.3.
toString
49.4.
Override toString
49.5.
@Override
49.6.
equals and hashCode
49.7.
Override equals and hashCode
50.
Generics
❱
50.1.
Type Variables
50.2.
Naming
50.3.
Instantiation
50.4.
Inference
50.5.
Soundness
50.6.
Raw Types
51.
Interfaces
❱
51.1.
Interface Declaration
51.2.
Implementation
51.3.
@Override
51.4.
Naming
51.5.
Subtypes
51.6.
Multiple Implementations
Data Types V
52.
Time
❱
52.1.
Instant
52.2.
Duration
52.3.
LocalDate
52.4.
LocalTime
52.5.
LocalDateTime
52.6.
Time Zones
52.7.
ZonedDateTime
52.8.
OffsetDateTime
52.9.
Date
53.
ArrayList
❱
53.1.
Ubiquity
53.2.
Add an item
53.3.
Size
53.4.
Get an item
53.5.
Loop over items
53.6.
Set an item
53.7.
Remove an item
54.
HashMap
❱
54.1.
Filing Cabinets
54.2.
Keys and Values
54.3.
Put Items
54.4.
Get Items
54.5.
Hash Functions
54.6.
Hash Collision
54.7.
Hash Distribution
54.8.
Reference Based Identity
54.9.
Value Based Identity
54.10.
Appropriate Keys
Concepts II
55.
Hyrum's Law
❱
55.1.
Authority
55.2.
Validity
55.3.
Emergent Properties
55.4.
Importance
Control Flow V
56.
Switch III
❱
56.1.
break
56.2.
fallthrough
56.3.
return
56.4.
default
56.5.
yield
57.
Recursion
❱
57.1.
Disclaimer
57.2.
Base Case
57.3.
Comparison to Delegation
57.4.
Comparison to Loops
57.5.
Counting Down
57.6.
Accumulators
57.7.
Recurse Over a String
57.8.
Recurse Over an Array
58.
Loops III
❱
58.1.
For-each loops
58.2.
Arrays
58.3.
Iterable and Iterator
58.4.
ArrayList
58.5.
String
58.6.
Concurrent Modifications
58.7.
Inferred Types
Concepts II
59.
Encapsulation
❱
59.1.
Implementation Details
59.2.
Methods
59.3.
Classes
59.4.
Implicit Interfaces
59.5.
Abstractions
59.6.
Leaky Abstractions
59.7.
Information Hiding
Data Types VI
60.
Collections
❱
60.1.
Collection
60.2.
List
60.3.
Map
60.4.
Set
60.5.
Arrays
61.
Multi-Dimensional Arrays
❱
61.1.
Declaration
61.2.
Array Initializers
61.3.
Initialization with new
61.4.
Access Individual Elements
61.5.
Set Individual Elements
61.6.
Initialization with Size
61.7.
Default Values
61.8.
Populate Values
61.9.
Ragged Arrays
Metaprogramming
62.
Reflection
❱
62.1.
Class Objects
62.2.
Get all Fields
62.3.
Get a Field
62.4.
Read from a Field
62.5.
Write to a Field
62.6.
Get all Methods
62.7.
Get a Method
62.8.
Invoke a Method
62.9.
Get a Constructor
62.10.
Get all Constructors
62.11.
Invoke a Constructor
63.
Annotations
❱
63.1.
Declaration
63.2.
Usage
63.3.
Elements
63.4.
Usage with Elements
63.5.
Defaults
63.6.
@Target
63.7.
@Retention
63.8.
Reflective Access
63.9.
@Override
Concepts III
64.
Abbreviations
❱
64.1.
Niches
64.2.
Usage Contexts
64.3.
Ambiguity
64.4.
Familiarity
64.5.
Elaboration
Code Structure VII
65.
Interfaces II
❱
65.1.
Default Methods
65.2.
Interface Extension
65.3.
Static Methods
65.4.
Private Static Methods
66.
Class Extension
67.
Abstract Classes
Data Types IV
68.
Niche Numerics
❱
68.1.
byte
68.2.
short
68.3.
long
68.4.
Unsigned Operations
Code Structure VIII
69.
Modules
70.
🚧 (More Chapters Planned) 🚧
Light
Rust
Coal
Navy
Ayu
Modern Java
Elaboration