Java Foundations
Read it before the compiler does
Java settles the type of everything before your program runs, and almost everything that surprises people is that decision arriving earlier than they expected. Read Java until you can say what a line prints — then write one file that turns a broken export into a report, and compile it yourself.
- Modules
- 6
- Drills
- 11
- Build steps
- 6
- Time
- ~5h
Walk out with
A Java file on your own machine that reads a messy export, refuses the rows that break its rules, and prints a totalled report with a bar per category.
What you'll do
Say what the value is
Truncation, promotion, wrap, and the 127 boundary.
Build a class that refuses
One door, checked — and the body a call really reaches.
Collections and generics
Pick the shape, then read what the brackets will accept.
Fail well, then pipeline it
Checked or not, where it goes, and what streams print.
The pitch
What you practise, and what you leave with
One Java file: it reads a messy seventy-row export, refuses the ten broken rows, and prints a totalled report with bars.
You will practise
- Name the type before you run it
- Say which body a call reaches
- Choose the collection from the rule
- Widen a signature so the call compiles
Afterwards you can
- Compile and run Java yourself
- Enforce an invariant in a constructor
- Explain why a generic call was refused
- Group and total in one pipeline
Modules
6 modules, 40 items
Lessons explain one idea. Drills repeat it until it sticks. Build steps make something that exists afterwards.
- 1
Say what the value is
~1hSay the type, the value and the truth of a Java line before you compile it.
- LessonWhy read Java before you write it5 min
- Build stepCompile and run one file10 min
- DrillSpot the error before javac does10 min
- LessonSay what a declaration fixes6 min
- LessonRead a var declaration5 min
- DrillName the type of the expression9 min
- LessonSettle the type before the value7 min
- DrillWork out the arithmetic9 min
- LessonAsk the right equality question7 min
- DrillCount the comparisons that hold10 min
- 2
Make a class keep its promise
~50 minWrite a type that cannot be built into a state it says is impossible.
- LessonBuild a class that cannot lie8 min
- LessonLet a record write the rest5 min
- LessonPromise what a caller can rely on6 min
- LessonSay which body answers the call7 min
- DrillSay which body runs10 min
- Build stepMake the constructor refuse14 min
- 3
Pick the collection the job needs
~41 minChoose between List, Set, Map and Deque from the requirement, not from the chapter.
- LessonMeet the four shapes6 min
- DrillChoose the collection10 min
- LessonPick the order you need7 min
- LessonThree traps that cost a day8 min
- DrillSay what the collection prints10 min
- 4
Read the angle brackets
~53 minRead a generic signature, and widen one so the call it refused compiles.
- LessonSee what the brackets buy you6 min
- LessonSee why the call was refused8 min
- LessonWiden a reader with extends6 min
- LessonAccept a writer with super6 min
- DrillSay whether the call compiles11 min
- LessonSee why the rules stop there4 min
- Build stepWiden the signature12 min
- 5
Put failure in the signature
~42 minDecide what to throw, and follow a failure out through catch and finally.
- LessonDecide what to throw8 min
- LessonFollow a failure out8 min
- DrillFollow the failure out11 min
- LessonValidate at the boundary6 min
- DrillPick the input worth testing9 min
- 6
Move the data through a pipeline
~1hTurn a messy export into a grouped, totalled report on your own machine.
- LessonSee why nothing happened8 min
- LessonGroup it with a collector6 min
- LessonHandle the empty result5 min
- DrillSay what the pipeline prints10 min
- Build stepLoad the ledger, skip the junk15 min
- Build stepGroup it and total it13 min
- Build stepPoint it at your own file8 min
More in Languages
Keep going
Python Foundations
Read a program before you run it. Then write one worth showing.
Foundational~6h8 modules
Python Fluency
Choose the shape before you type. Then say it in one line.
Intermediate~5h7 modules
Python Confidence
Somebody else wrote it. Find out whether it works.
Advanced~7h7 modules
Python Craft
It works. Now make it somebody else's.
Advanced~10h7 modules
Say what a Java line prints. Then compile one that earns its output.
The first item is free. ~5h of focused work, at your own pace.
Intermediate~5h6 modules