Before the bell
You are responsible for all of this before the end of class.
- The discussion form in the I Do deck. All three sections. If you are here, this should be done.
- Your classwork. This form on the right. Section 1 before the exit ticket pops up; Section 2 past the floor.
- Today's Bench Basics activity: Java Symbols. It opens later in class and lives on slide 4 of this deck.
- The exit ticket. It opens 15 minutes before the bell and lives on the last slide of this deck.
The classwork form is not linked yet. Use Station View and write your answers in your lab notebook with the item labels.
Java Symbols and Their Jobs
This reading explains the small set of symbols that Java uses and the job that each one does. Today's bench, Java Symbols, asks for each symbol to be typed exactly and matched to its job.
The Symbols
Java's official rules sort most of these symbols into separators, which mark where the parts of a program begin and end, and operators, which work on values. The table below gives each symbol its job, in the same words the bench uses where it can.
symbol its job example
{ } start and end a block of lines the body of a class or of main
( ) hold what a method is given, println("Hi") (4 < 9)
or group a condition
[ ] mark a list of values String[] args
; ends a statement int count = 3;
" " mark text that prints as written "count holds a value"
< > compare two values: less than, 4 < 9
greater than
= stores a value in a box count = 3
! means not !(4 < 9)
&& means and: both sides must be true 9 > 4 && 2 > 5
|| means or: one true side is enough 9 > 4 || 2 > 5
The symbol `=` stores the value on its right in the box on its left, as on the Store It bench. It does not ask whether two values are equal, because Java uses `==` for that question.
One Program, Line by Line
The worked program below has eleven lines, counted from the top, and its real output follows it.
1public class Main { 2 public static void main(String[] args) { 3 int count = 3; 4 System.out.println("count holds a value"); 5 System.out.println(count); 6 System.out.println(4 < 9); 7 System.out.println(9 > 4 && 2 > 5); 8 System.out.println(9 > 4 || 2 > 5); 9 System.out.println(!(4 < 9)); 10 } 11}
count holds a value 3 true false true false
Line 1 opens a brace that holds the body of the class, and line 11 closes it. Line 2 opens the block for `main`, and its parentheses hold `String[] args`, where the square brackets mark a list of text values. Line 3 stores 3 in the box `count` with `=`, and its semicolon ends the statement. The word `int` belongs to next week's bench, Boxes and Types, since today's job is the symbols. Line 4 prints the text inside the quotation marks exactly as written. Line 5 has no quotation marks, so it prints what `count` holds, which is 3. Lines 6 to 9 follow the rules from the True or False bench, and line 6 prints true, because 4 is less than 9. Line 7 prints false, because `&&` needs both sides to be true and 2 is not greater than 5. Line 8 prints true, because `||` needs only one true side. In line 9 the exclamation mark flips the true result of `4 < 9`, so the line prints false. Line 10 closes the block for `main`.
Typing the Symbols
On a Chromebook keyboard, the square brackets sit just to the right of the P key, and the braces are the same keys with Shift held down. The quotation mark is Shift with the apostrophe key, which is just left of Enter. The bar `|` is Shift with the backslash key, above Enter. In Java's symbols for and and for or, the `&` and the `|` are each typed twice, with no space between them. The bench also asks for each key on its own as typing practice, but this course always writes and as `&&` and or as `||`.
Sources: Oracle, Expressions, Statements, and Blocks (n.d.); Oracle, Equality, Relational, and Conditional Operators (n.d.); Oracle, Assignment, Arithmetic, and Unary Operators (n.d.); Oracle, Arrays (n.d.); Oracle, The Java Language Specification, Java SE 21 Edition (n.d.).
Generated Code, Gaps and Assumptions
This section explains how a model writes a program from a short description, and why that program can differ from the one the person had in mind.
How a Model Writes Code
A person can ask a language model for a program in the same way that a person asks it for a paragraph. Generated code is code that a model writes from a description. The model produces it the same way it produces any other text, by predicting a likely next token, adding it, and repeating. In a 2021 paper, researchers at OpenAI described Codex, a language model trained on public code, which wrote programs from short written descriptions of what each program should do. The researchers produced each program by taking tokens from the model one at a time until it reached a stopping point. As the Oct 20 lesson explained, a model that generates an answer does not retrieve a stored copy of it, so each program is new text built from the model's parameters. Code a person typed is not generated code, even when it looks exactly the same as code that a model wrote.
A Request With Gaps
In October 2026, the class's model, Mistral Small, received a request through the class endpoint. A short system prompt told the model to reply with only Java code, in one class named Main. The request below, called request 1, is shown exactly as it was sent.
Write a short Java program that prints a birthday message for my friend. Use only System.out.println.
The model replied with the program below, word for word. It was then compiled and run with the course's copy of Java, and the output under the program is what it printed.
1class Main { 2 public static void main(String[] args) { 3 System.out.println("Happy Birthday, Friend!"); 4 System.out.println("Wishing you a day filled with joy and laughter!"); 5 System.out.println("May all your dreams come true this year!"); 6 } 7}
Happy Birthday, Friend! Wishing you a day filled with joy and laughter! May all your dreams come true this year!
The program compiles and runs with no error, but it is still not the program the person pictured, because the request left things out. A gap is a part of a program that the description says nothing about. Request 1 never gave the friend's name, the friend's age or the words of the message. Figure 1 lines up what request 1 says with what the model wrote, row by row, and marks each row as a match or a gap. A detail the request states exactly is not a gap. The words "Use only System.out.println" left nothing to guess about how to print, and every line the model wrote prints with System.out.println.
How a Model Fills a Gap
When a description says nothing about part of a program, the model fills the gap with its own guess. An assumption is that guess, written into the code as if someone had asked for it. In request 1, the model used the placeholder Friend, with a capital F, in the place where a name belonged. It also generated three lines, and every word in them came from the model, including a wish for a day filled with joy and laughter. The program prints no age, and its last line says "this year" instead. An assumption is not a mistake by itself, since a reader might be happy with all three lines, but it becomes a problem when it is not what the person wanted. For example, a friend named Jada would expect to see her own name, so the person would want to change the assumption that she can be called Friend.
Closing the Gaps
The second request, called request 2, filled the gaps in request 1. It gave the friend's name, her age and the exact two lines to print.
Write a short Java program that prints a birthday message for my friend Jada, who is turning 15. Print exactly two lines: "Happy birthday, Jada." and "Fifteen looks good on you." Use only System.out.println.
The model's reply and its real output are below, in the same form as the program for request 1.
1class Main { 2 public static void main(String[] args) { 3 System.out.println("Happy birthday, Jada."); 4 System.out.println("Fifteen looks good on you."); 5 } 6}
Happy birthday, Jada. Fifteen looks good on you.
This time the model wrote exactly the two lines that the request asked for, and the output matches the request word for word. Where a description is exact, a model usually follows it, although the Codex researchers reported that their model still had trouble with descriptions that listed long chains of steps. Because a model can follow most of a description and still guess at the rest, generated code is read in three steps. First, a person reads the code, and next, the person compiles and runs it. Then the person compares the code and its output with the description, line by line, and marks each line as a match or a gap. The Codex researchers judged their programs in a similar way, by running each one against tests instead of only reading it. A guess that happens to be right is still a guess, so every line the description did not ask for gets checked.
Summary
Generated code is code that a model writes from a description by predicting one token at a time. A gap is a part of a program that the description says nothing about, and the model fills each gap with an assumption, which is its own guess written into the code. Reading the code, running it and comparing it with the description line by line shows which lines match and which ones are assumptions.
Sources: Google, Introduction to Large Language Models (2026); Chen et al., Evaluating Large Language Models Trained on Code (2021); class endpoint, Code Coach classroom data, generated-request1 (2026); class endpoint, Code Coach classroom data, generated-request2 (2026).
The classwork form is not linked yet. Use Station View and write your answers in your lab notebook with the item labels.
MC 1. In today's passage, what is a gap?
- A line of code that stops the program from compiling
- A part of a program that the description says nothing about
- A detail that the request states exactly, such as how to print
- The empty space between two lines of a program
MC 2. According to the passage, what did the class's model do where request 1 said nothing about the friend's name?
- It printed the line with a blank space where the name belonged.
- It wrote a reply that asked for the friend's name first.
- It filled the gap with its own guess, the placeholder Friend.
- It printed the word name in brackets, as a note for the person to fill in.
MC 3. The class's model was sent this request: Write a Java program that prints a three-line sign for the book fair. The first line says "Book Fair" and the second line says "In the library". Use only System.out.println. The model wrote the program below, word for word, with its lines numbered from 1. Which line shows an assumption?
1class Main { 2 public static void main(String[] args) { 3 System.out.println("Book Fair"); 4 System.out.println("In the library"); 5 System.out.println("Book Fair"); 6 } 7}
- Line 3, the first line that prints Book Fair
- Line 4, the line that prints In the library
- Line 5, the line that prints Book Fair a second time
- Line 1, the line class Main {
MC 4. Request 1's program compiles and runs with no error. Why can it still miss what the person wanted?
- A program that runs with no error always matches its description.
- The request left out details, so the model filled them with guesses.
- The model did not follow the instruction to use only System.out.println.
- Java changes the words of a message when the program runs.
MC 5. In the program below, which symbol ends each statement?
1public class Main { 2 public static void main(String[] args) { 3 System.out.println("Bus 94"); 4 System.out.println("Canal Street"); 5 } 6}
- The closing brace }
- The closing parenthesis )
- The semicolon ;
- The period in System.out.println
MC 6. In the program below, which pair of symbols holds the block of lines that belongs to main?
1public class Main { 2 public static void main(String[] args) { 3 System.out.println("Gate 3"); 4 } 5}
- The parentheses ( ) after main
- The braces { } that open at the end of main's first line
- The square brackets [ ] after String
- The quotation marks " " around Gate 3
MC 7. In the program below, which pair of symbols marks text that prints exactly as written?
1public class Main { 2 public static void main(String[] args) { 3 int laps = 4; 4 System.out.println("Laps run:"); 5 System.out.println(laps); 6 } 7}
- The quotation marks " "
- The parentheses ( )
- The braces { }
- The equals sign and the semicolon
MC 8. In the line public static void main(String[] args) from the program below, what do the square brackets [ ] mark?
1public class Main { 2 public static void main(String[] args) { 3 System.out.println("Doors open at 6"); 4 } 5}
- The end of the statement
- Text that prints exactly as written
- The start and end of main's block of lines
- A list of values, here a list of text values
MC 9. The program below prints false. What does && mean in it, and why is the result false?
1public class Main { 2 public static void main(String[] args) { 3 System.out.println(7 > 2 && 3 > 8); 4 } 5}
- And: both sides must be true, and 3 > 8 is false.
- Or: one true side is enough, and 7 > 2 is true.
- Not: it flips the result of 7 > 2.
- It stores 3 in a box, so nothing is compared.
MC 10. The program below has two print lines. The first one prints false. What does the second one, the line with the exclamation mark, print?
1public class Main { 2 public static void main(String[] args) { 3 System.out.println(6 > 10); 4 System.out.println(!(6 > 10)); 5 } 6}
- false
- true
- 6 > 10
- Nothing, because the line does not compile.
CR 1. Match each of the eight symbols to its job. Write each symbol's number with the letter of its job, for example 1-C. Each job is used once.
symbols jobs
1. ; A. means not
2. { } B. compare two values: less than
3. ( ) C. ends a statement
4. [ ] D. stores a value in a box
5. " " E. start and end a block of lines
6. < F. mark text that prints as written
7. = G. mark a list of values
8. ! H. hold what a method is given
Write your answer in your lab notebook, labeled CR 1.
CR 2. A request reads, "Write a Java program that prints a packing list for a field trip." Name two gaps in it. For each one, say what the model would have to guess.
Write your answer in your lab notebook, labeled CR 2.
The classwork form is not linked yet. Use Station View and write your answers in your lab notebook with the item labels.
CR 3. Read the five-line program below. For each pair of symbols, the braces { }, the parentheses ( ) and the quotation marks " ", say what it holds in this program.
1public class Main { 2 public static void main(String[] args) { 3 System.out.println("Tickets: 2"); 4 } 5}
Write your answer in your lab notebook, labeled CR 3.
CR 4. Rewrite the field-trip request from CR 2 so that it has no gap in the two places you named. Keep "Use only System.out.println." at the end.
Write your answer in your lab notebook, labeled CR 4.
Java Symbols
Open the bench, do its six jobs, then paste your credit code into the credit-code form. You can turn in up to three codes per bench; your best score is your grade.
Bench Basics opens during your class period.
The classwork form is not linked yet. Use Station View and write your answers in your lab notebook with the item labels.
This opens during your class period.