This page is about the course itself rather than Java. It covers the two ways each idea is explained and how the course learns which computer you use. It explains the labels that tell you how new a feature is, and what happens to code you type into a question. It ends with the part of learning Java that happens on your own machine.
Two explanations and your setup
Almost every idea here is written two ways, and you choose which one you read. Textbook is the exact version, using the words Java programmers and Java's own documentation use. Plain English is written for a newcomer, in everyday words. It explains each new word the moment it shows up. Both versions say the same things; Plain English is not a cut-down copy. A switch above each explanation flips between them, and the course remembers your pick.
Some steps depend on your computer, like how to open a terminal (the typing window from the last page). Those steps come as tabs, one tab per kind of computer or app.
You tell the course about your computer once, in the My setup panel on the course page. It asks which operating system you use: Windows, macOS, or Linux. It also asks which app you'll write Java in. The choices are IntelliJ IDEA, Eclipse, VS Code, NetBeans, or just a terminal and a text editor. Chapters 1 and 2 help you pick. After that, every tabbed block opens on your choice. Click a different tab anywhere, and the course switches everywhere.
Most ideas are explained twice, side by side. The Textbook lane is precise: it uses the standard terms and states rules in full, the way Java's documentation or a job interview would. The Plain English lane covers the same ground for someone meeting it for the first time, in everyday words, explaining each new term where it appears. The two lanes make the same claims; neither is a summary of the other. A switch above each explanation flips between them, and your choice is kept as you move through the course.
Some instructions depend on your computer. Those appear as tabs, one per option, and they are grouped. You set each group once under My setup on the course page (or in Settings). One group is your operating system: Windows, macOS, or Linux. Another is your environment, the app you write and run Java in: IntelliJ IDEA, Eclipse, VS Code, NetBeans, or the plain command line. Two further groups matter only in later chapters, and each of those chapters says when to set them. Picking a tab in any lesson updates your setting everywhere. A tabbed block that doesn't offer your choice opens on its first tab and leaves your setting alone.
Here is a small taste of an environment-tabbed block. Each tab shows how you will start a program once Chapter 2 has set that app up.
IntelliJ IDEA runs on Windows, macOS, and Linux. Open your .java file
and click the green triangle beside the line void main() {, then
choose Run.
Eclipse runs on Windows, macOS, and Linux. Right-click inside your
.java file and choose Run As, then Java Application.
VS Code runs on Windows, macOS, and Linux, with Microsoft's Extension
Pack for Java added. A small Run link appears just above
void main() {; click it.
Apache NetBeans runs on Windows, macOS, and Linux. Right-click your
.java file in the file list and choose Run File.
Any text editor plus a terminal works. In the folder that holds your file, type:
java Hello.java
The apps in the other tabs use this same Java underneath.
Worked example
Setting up once
-
1
Amara has a Windows laptop and plans to use IntelliJ IDEA. On the course page she opens My setup and picks Windows and IntelliJ IDEA.
-
2
In Chapter 1 the install steps open straight on the Windows tab. In Chapter 2 the "run your program" steps open on IntelliJ IDEA. She never hunts for the right tab.
-
3
Later she wants to see how VS Code does it and clicks its tab in a lesson. From then on every environment tab opens on VS Code, because a tab picked anywhere becomes the setting everywhere.
-
4
One block only covers Eclipse and the command line. It opens on its first tab, Eclipse. Her saved choice is unchanged and applies again at the next block that offers VS Code.
Practice: Explanations, tabs, and My setup (5 problems · doesn’t affect your progress)
Mateo reads only the Plain English lane. What does he miss?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Plain English isn't a lighter version. It covers the same ground, explaining each term as it appears.
Worked examples and questions sit outside both lanes and are the same for everyone.
Both lanes run through the whole course.
Why
The lanes differ in wording, not content. Textbook uses the standard technical terms; Plain English explains each one in everyday words.
No ideas: both make the same claims
Sort each choice into the My setup group it belongs to.
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Why
Windows, macOS, and Linux are operating systems. IntelliJ IDEA, NetBeans, and the plain command line are environments for writing and running Java.
Correct answer
Also accepted:
Why
Sort each step or fact: does it change with your operating system (so it would come as tabs), or is it the same on every computer?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Why
Tabs are for steps that really differ by computer: opening a terminal, the key that opens search (Start or Cmd+Space), where your home folder lives. Facts about Java itself, like what a line prints, what a compiler does, and the top-to-bottom order, are the same everywhere and aren't tabbed.
Correct answer
Also accepted:
Why
Would the answer be different on Windows than on a Mac?
Mateo usually works on Windows but spends a week on a Linux laptop. What's the quickest way to get Linux instructions everywhere?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
The lanes are about wording. Operating-system steps live in tabs.
One setting covers it. A tab click anywhere updates the whole course.
Each block opens on one tab, the one matching your setting.
Why
Your operating-system choice decides which tab every block opens on. Changing it once, in My setup or by clicking a tab, switches the whole course.
Change My setup, or click any Linux tab
Your environment setting is NetBeans. A block offers only IntelliJ IDEA and VS Code, and you click VS Code to read it. What is your setting now?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
If you'd only looked, NetBeans would have stayed. Clicking a tab is a choice, and it updates your setting.
The first tab is only what the block opens on. It never changes your setting.
Settings are replaced, not cleared.
Why
A block that lacks your choice opens on its first tab without touching your setting, but clicking a tab always becomes your new setting.
Opening on a tab and clicking a tab are different things.
VS Code, because clicking a tab sets it
Labels on features, and asides about older code
A new version of Java comes out twice a year, in March and September. This course uses Java 25, from September 2025. Not every feature exists in every version, though. So a feature that depends on the version, or that comes from outside Java, gets a short bold label where it's taught:
- Stable means finished, permanent, and part of Java for a long time. Any Java code you meet might use it.
- Recent means finished and in your Java 25, but new: it arrived in version 21 or later. Older code won't use it, and an older Java install won't accept it.
- Newer release means it only exists in versions after 25. Your Java 25 doesn't have it. You're told about it so you recognize it.
- Preview means it's in Java 25 but not finished. You have to
switch it on with a special option,
--enable-preview. It may still change or be removed. - Library means the code doesn't come with Java at all. It's ready-made code, written by someone else, that you add to your own work.
- Framework-specific means it only works inside one big toolkit that organizes a whole app, such as one called Spring.
Java is about thirty years old, so you'll read much more old code than you write. When the course teaches a modern way of doing something, it often adds an example titled Legacy / existing code. That example shows the older way, so it won't confuse you when you see it. In your own code, use the modern way.
Java gets a new version every six months, each March and September. This course targets Java 25, released in September 2025, and labels any feature whose availability depends on a version or on something outside Java itself. A label sits in bold beside the feature where it is taught:
- Stable: final (finished and permanent) in Java 25 or earlier, and long established, so any Java code you meet may use it.
- Recent: also final in Java 25, but only since a version between 21 and 25. Code written for older versions won't use it, and an older installation won't accept it.
- Newer release: final only in a version after 25. Your Java 25 does not have it; it is named so you recognize it.
- Preview: present in Java 25 but unfinished. It works only when
switched on with the option
--enable-preview, it may change or disappear, and this course never teaches it as settled. - Library: not part of Java at all, but ready-made code from other people that you add to your own (JUnit for tests and Jackson for JSON, for example).
- Framework-specific: works only inside one framework, a large body of ready-made code that shapes a whole application and calls your code, such as Spring.
Java has been in use for three decades, so you will read far more existing code than you write. Where a modern form replaces an older one, the lesson teaches the modern form and adds a worked example titled Legacy / existing code, showing the older form you will meet so you can read it. Write the modern form in your own code.
Which label does each feature get?
Sort each feature under the label this course would give it.
Loading interactive…
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Correct answer
Also accepted:
Why
Why
IO.println became final in Java 25, so it is Recent. if has been in Java from the start: Stable. Needing --enable-preview is what makes a feature Preview, and final only after 25 is Newer release. JUnit and Jackson come from outside Java: Library. Code that only works inside Spring is Framework-specific.Here is what a legacy aside looks like. The first program is the long form that every Java version before 25 required. It prints the same line as the short form after it.
public class Hello {
public static void main(String[] args) {
System.out.println("Hello!");
}
}
Hello!
void main() {
IO.println("Hello!");
}
Hello!
Worked example
Legacy / existing code: the long way to say hello
-
1
Both programs above print
Hello!. The second is the form this course teaches first, a short file labelled Recent because it became final in Java 25. -
2
The first is the form you'll see in most existing code, older books, and many answers online, because until Java 25 every program had to be written that way.
System.out.printlndoes the printing there. -
3
You don't need to understand
public class,static, orString[] argsyet; Chapter 3 explains each word. For now, recognizing "this is the long form of a whole program" is enough. -
4
In your own code, use the form the lesson teaches. When an older codebase or a job uses the long form, you'll be able to read it, and Chapter 3 shows how to write it too.
Check your understanding (counts toward your progress)
Your setup says Linux. In a lesson you click the macOS tab on one block. What happens next?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Picking a tab anywhere updates the setting for the whole course, not just that block.
Tabs are there to be clicked. That's how you switch.
Nothing is cleared. The click replaces Linux with macOS.
Why
A tab picked anywhere becomes your setting everywhere. Click the Linux tab, or change My setup, to switch back.
Tabs in one group stay in step across the whole course.
This course targets one version of Java and labels features against it. Type that version number.
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Why
The course is written for Java 25. Features from later versions are labelled Newer release, and older forms appear in Legacy asides.
Correct answer
Also accepted:
Why
It was released in September 2025.
How do the Textbook and Plain English explanations relate?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Plain English isn't a cut-down version. It covers the same ground for someone meeting the idea for the first time.
Either lane is open to anyone. Many readers switch between them on the same page.
Both lanes explain the same idea, so reading one is enough to follow the page.
Why
The two lanes say the same things. Textbook uses the precise terms Java's documentation uses; Plain English explains each term as it appears.
Where do you tell the course which operating system and which environment you use?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Setting it once is enough. Tabbed blocks then open on your choice everywhere.
No message is needed. The setting lives in the course itself.
Options do come as tabs, but they open on your saved choice instead of all at once.
Why
My setup stores your choices. Every tabbed block in the course then opens on the matching tab.
Practice: Feature labels and legacy asides (5 problems · doesn’t affect your progress)
Which label means a feature is finished and has been part of Java for a long time?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Recent features are finished, but they only arrived in version 21 or later.
Preview features aren't finished yet.
Newer release features aren't in Java 25 at all.
Why
Stable means final and long established, so any Java code you meet may use it.
Stable
Your Java is version 25. Sort each feature: can you use it as it is, or not?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Why
Stable and Recent features are final in Java 25 or earlier, so they just work. A Newer release feature only exists after 25. A Preview feature needs --enable-preview switched on, and a Library feature isn't part of Java until you add its code.
Correct answer
Also accepted:
Why
Is it finished, in a version no later than 25, and part of Java itself?
Which label would a feature get if it only works inside a Spring application?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Library is for add-on code in general. Code that only works inside one big toolkit like Spring gets the narrower label.
Preview is about unfinished parts of Java itself.
Stable describes features of Java itself.
Why
A framework is a large body of ready-made code that shapes a whole application. Features that only work inside one are Framework-specific.
Framework-specific
Your team's servers still run Java 17. A feature is labelled Recent because it became final in Java 25. Can the team use it on those servers?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Finished in 25 doesn't reach back to 17. That gap is exactly what the Recent label warns about.
That option is for Preview features in the version you're running. Java 17 doesn't contain this feature in any form.
Add-on code is what the Library label is for. This feature is part of Java itself, from 25 on.
Why
A Recent feature became final between Java 21 and 25, so an installation older than that version doesn't have it. That's the reason the label exists.
Which versions does a Recent feature exist in?
No: Java 17 is older than the version that made it final
A colleague's code prints with System.out.println inside public static void main(String[] args). This course taught IO.println inside void main(). What should you conclude?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
The long form compiles and runs fine on Java 25. It's older, not broken.
Preview means unfinished and new. The long form is the opposite: old and settled.
The course teaches the modern form for your own code, and Chapter 3 shows when the long form is needed.
Why
That's exactly what a Legacy / existing code aside prepares you for: read the older form with confidence, and keep writing the modern one.
It's the older long form; read it, but write the form taught here
Checks, practice, and bug hunts
You'll meet two kinds of question set. A check sits in the middle of a lesson. It shows a few questions picked at random from a bigger pool, so a later visit gives you different ones. Checks are marked. The course also uses them to decide which topics to bring back later for review.
A practice set sits at the end of a topic. It's a short ladder of 4 to 6 problems that always come in the same order. The first asks about the idea itself. Then comes an easy one, a normal one, and one with a twist. The last one hides a trap. Practice isn't marked, because its job is to let you do the thing, not just read about it. Each chapter also ends with a wrap-up page with review problems from every section.
Some questions are about code. You might type what a program prints, drag lines into the right order, or fill in a missing word. A bug hunt gives you a short program with mistakes planted in it; a mistake in a program is called a bug. The task always says how many there are. Sometimes you just click the broken lines. Sometimes you edit the code and press Check. Then it tells you which mistakes you fixed, and whether the code is still correct Java.
A check, the question block inside a lesson, draws a few questions at random from a larger bank, so a later visit shows a different mix. Checks are graded, and the results feed your progress and the review schedule that decides what to show you again. A practice set is a fixed list of 4 to 6 problems in the same order every visit. It opens with a question about the idea, climbs through a basic case, a typical one, and a variation, and ends on the one with a catch. Practice is ungraded. Each chapter ends with a wrap-up page whose review practice covers every section.
Code questions come in four forms. Predict the output asks you to type exactly what a program prints; the others are put the lines in order, fill in the blank, and the bug hunt, a short program with planted mistakes whose task always states how many. A bug hunt has two modes. In spot mode you click the broken line or lines. In fix mode you edit the code in place and press Check, and the checker reports whether each planted mistake is gone and whether the code is still written as valid Java.
Bug hunt, spot mode
This program has 1 mistake that stops it from compiling. Click the line that's wrong.
Loading interactive…
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Correct answer
Also accepted:
Why
Why
Total and never closes it, so the compiler reads the rest of the line as text and cannot find where the instruction ends. A closing quote right after 12 fixes it.Worked example
Working a bug hunt
-
1
The task says "1 mistake." Believe it: you are looking for one line, and once you have a clear culprit you can stop.
-
2
Read top to bottom and check one thing at a time on each line. Does every opening quote have a closing quote? Every
(a)? Does every instruction end in;? IsIO.printlnspelled with exactly those capitals? -
3
Lines 1 and 2 pass. Line 3 has
"Total: 12with no closing quote before the). That's the bug. -
4
In fix mode you would add the missing
"and press Check. If the checker still says the code isn't valid Java, the edit itself caused a new problem; compare your line, character by character, with a working line above it.
Check your understanding (counts toward your progress)
Sort each description of a question block: does it describe a check or a practice set?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Why
A check is a random, graded sample that feeds progress and review. A practice set is a fixed, ungraded ladder that ends on the problem with the catch.
Correct answer
Also accepted:
Why
Which one changes between visits, and which is a fixed ladder?
A bug hunt says "Fix the 2 mistakes." What does the number tell you?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
The number counts mistakes in the code, not attempts.
It's a count, not a line number. You still have to find where they are.
The number is about the program's mistakes, not scoring.
Why
A bug hunt always states how many mistakes are planted, so you know when you've found them all.
Bug hunt, fix mode: this program has 1 mistake. Fix it so it compiles and prints both lines.
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Why
Line 2 opens a quote before Gym and never closes it. Add " after active, before the ).
Correct answer
Also accepted:
Why
Count the quote marks on each line.
Bug hunt, spot mode: click the 1 line that stops this program from compiling.
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Why
Line 4 ends in ) with no ;. Every instruction needs its closing semicolon.
Correct answer
Also accepted:
Why
Check the end of every line inside the braces.
Practice: Bug hunts (5 problems · doesn’t affect your progress)
A bug hunt says "1 mistake" and you've found a line that's clearly broken. What next?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
The stated count is exact. Trust it.
Rewriting risks adding new mistakes.
Deleting a line would lose part of the program. The task is to repair it.
Why
The number of mistakes is always given. Once you've found that many, you're done looking.
Stop searching: the count says there's only one
Spot mode: a set of instructions for a printer, with 1 mistake. Click the broken line.
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Why
Line 3 ends without a ;.
Correct answer
Also accepted:
Why
Spot mode: a hotel sign program with 1 mistake. Click the line.
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Why
Line 3 opens a quote and never closes it.
Correct answer
Also accepted:
Why
Count the quote marks on each line.
Fix mode: fix the 1 mistake so the program compiles.
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Why
Println has a capital P. Java's name is println, all small letters.
Correct answer
Also accepted:
Why
Compare line 3 with line 2, letter by letter.
Spot mode: this program has 2 mistakes. Click both broken lines.
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Why
Line 3 uses a small io, and line 5 has no ;. Each one alone would stop the program from compiling.
Correct answer
Also accepted:
Why
One mistake is a letter's case; the other is punctuation.
What the page checks, and what you run yourself
When you type code into a question on this site, the site never runs it. Your code goes to our server, and a Java parser reads it. A parser is a program that reads code the way a grammar checker reads a sentence. It can tell whether the code is written correctly, and whether you included the piece the question asked for. It cannot tell what your code would do if it ran. A grammar checker can't tell whether a sentence is true, either. The parser also can't tell whether a name you typed really exists.
So where do the outputs on the pages come from? Before the course went live, our build ran every example program with the real Java tools. That tool kit is called the JDK, short for Java Development Kit; it's free, and you'll install it in Chapter 1. The build then checked that each output on the page matched what really printed. If it didn't match, the page wasn't published. No person typed those outputs in.
Running your own code happens on your own computer. From Chapter 1,
each lab gives you a small .java file, and you run it with one
command, java Hello.java. From Chapter 6, labs come with tests:
small extra programs, already written, that check whether yours works.
One command runs them all. Watching a program run one line at a time,
which you'll try in Chapter 2, happens on your computer too.
Code you type on a lesson page is never compiled or run. The course's server checks it with a Java parser: a program that reads source code and works out its structure (which parts are instructions, where each one begins and ends, which names it mentions) without translating or running it. The parser decides whether your code is written as valid Java and whether it has what the task asked for, such as a particular line. That makes checking fast and safe, and it also sets the limits. A parser knows the shape of your code, not what the code would do. It cannot tell that a name you used doesn't exist, and it cannot tell what the program would print.
So anything a page shows a program doing was produced ahead of time: the output under an example, the answer to a predict-the-output question, an error message quoted in a lesson. When the course is built, every one of those programs is compiled and run on a real JDK 25. A JDK (Java Development Kit) is the free set of Java tools you install in Chapter 1. The build fails if a page doesn't match what really happened.
Running is your machine's job. From Chapter 1, labs hand you a small
.java file to run with java Hello.java. From Chapter 6, labs arrive
as starter folders with tests already written (small programs that
check your work), and one command runs them all. Pausing a running
program to watch it one line at a time, met in Chapter 2, also happens
on your machine.
Built, checked, or run?
Sort each activity by where and when it happens.
Loading interactive…
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Correct answer
Also accepted:
Why
Why
java Hello.java to a lab's tests, happens on your machine.Worked example
Checked is not the same as run
-
1
A bug-hunt question shows
IO.println("Hi")with its semicolon missing. Priya fixes it but also, by accident, types a smalli:io.println("Hi");. She presses Check. -
2
The parser looks at shape.
io.println("Hi");is a well-formed instruction: a name, a dot, another name, matched brackets, quoted text, and a semicolon. As far as shape goes, nothing is wrong. -
3
The real compiler on Priya's machine would stop with
cannot find symbol, because Java providesIO, notio. The parser can't know that, since it never looks up what names mean. That's why a careful question also checks for the exact text it needs, and this one tells her the line still doesn't match. -
4
The habit that follows: a passing page check shows the code is shaped right. A program that runs on your machine and passes its tests shows it works.
Worked example
Trusting an output you didn't run
-
1
A lesson shows a short program and, under it, an output box with
Hello!,Welcome to Java., and7. -
2
Nobody typed that box. When the course was built, the program ran on a real JDK 25 and the box was compared with what it printed. A mismatch would have stopped the page from being published.
-
3
So when your prediction disagrees with a page's output, the page is right and your reading has a gap. That's the moment to slow down and trace the program again, line by line.
Professional habit: when a program surprises you, run it. This course trains careful reading hard, but a real run on your own machine settles a disagreement faster than rereading.
Where this goes next
Chapter 1 §4 is where you install a JDK on your own machine, using the
operating-system tab you picked here. Chapter 1 §5 is your first lab: a
.java file you run with java Hello.java. Chapter 2 §2 creates and
runs a program in the app you chose under My setup, and Chapter 2 §4
pauses a running program to look inside it. Chapter 6 brings the first
lab with prewritten tests.
Check your understanding (counts toward your progress)
Which of these can a parser NOT tell you about your code?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Matching brackets is part of a program's shape, which is exactly what a parser reads.
Missing semicolons are shape problems, and a parser spots them.
A parser can look for a particular line in your code.
Why
A parser knows the structure of code, not its behavior. What a program prints only comes from running it.
A parser reads the code's structure. Which of these needs the program to actually run?
How did the output box under an example program get onto a lesson page? Put the steps in order. One step doesn't belong.
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Why
When the course is built, every example runs on a real JDK 25 and the page's output is compared with what printed; a mismatch stops the page from being published. Your browser never runs anything, so that's the step that doesn't belong.
Correct answer
Also accepted:
Why
Nothing on a lesson page ever runs code. When did the running happen?
From Chapter 1, each lab hands you a small .java file to run on your own machine. Complete the terminal command that runs the lab file Timer.java.
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Why
java Timer.java runs the lab's file on your own computer. Labs are where your own Java really runs; nothing on a lesson page runs it.
Correct answer
Also accepted:
Why
It's the same command this chapter showed for running Hello.java.
The course's build runs every example on JDK 25, and you install a JDK in Chapter 1. What do the letters JDK stand for?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Why
JDK stands for Java Development Kit: the free set of Java tools you install in Chapter 1. The course's build uses JDK 25 to run every example.
Correct answer
Also accepted:
Why
It's the kit of tools you develop Java with.
Practice: What the page checks, and what you run (5 problems · doesn’t affect your progress)
Sort each place: is Java code really run there, or never run there?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Why
The build runs every example on a real JDK 25, and you run your own code and tests on your machine. A lesson page only reads your code with a parser, and your browser runs nothing.
Correct answer
Also accepted:
Why
What is a parser?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Running is exactly what a parser never does.
A compiler also translates. A parser stops at working out the structure.
That's the terminal.
Why
A parser reads code the way a grammar checker reads a sentence: it can tell whether the code is well formed, not what it would do.
A program that works out code's structure without running it
Sort each question: can a parser answer it, or does it take a real run?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
What this task checks
Structure checked automatically. Whether your ideas are convincing isn't graded, so reread with the checklist.
The compiler says
A model answer
Why
Brackets, semicolons, and which names appear are all shape. Output and test results only come from running the program.
Correct answer
Also accepted:
Why
A lesson quotes the error message ';' expected for a broken program. Where did that message come from?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Quoted messages are not written from memory. The build checks each one against a real compile.
Your browser doesn't compile Java.
The answer-checking parser runs when you press Check, not when a lesson is written.
Why
Error messages shown in lessons are produced by a real compiler at build time, just like example outputs.
A real Java compiler, when the course was built
Kenji's fill-in-the-blank answer IO.println(totl); passes the page's shape check, but the program uses the name total. What would happen on his machine?
Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.
Without quotes, totl is a name, not text to print.
Java doesn't guess what name you meant.
The page checks shape only. Whether totl exists is something only the compiler checks.
Why
The shape is fine, so the parser can accept it. The real compiler looks up every name, finds no totl, and refuses the file.
Does the parser look up whether a name exists?
cannot find symbol: the program has no name totl