25sp ver.
Note: this is for the Spring 2025 iteration of CSE 121. Looking for a different quarter? Please visit https://courses.cs.washington.edu/courses/cse121/.
This glossary defines common terms used in our class. Most are split up by the week they are introduced, though you can skip to course-specific terms for acronyms and words that are about our class itself (rather than computer science concepts).
This glossary is a new experimental resource! We’d love to hear from you with questions, suggestions, or concerns. Post on Ed!
Week 1: Java Basics; Printing, Strings, and Variables¶
- bug: an error in a program
- class*: a file in Java where code is written
- Note: all code you write in CSE 121 goes into one class
- class comment: a comment that explains a program and its general functionality
- comment: text in a code file that does not affect the behavior of a program
- compiler: a program that translates a programmer's instructions into a form that is more usable by a computer
- console: the place where a program's printed output appears
- debugging: the process of finding and fixing bugs
- executes/runs: when a computer reads a set of instructions written in code and performs them
- hardcode: the practice of placing fixed, unchangeable values directly into code that cannot be modified without modifying the program
- header comment: a comment at the top of a program that includes your name, the date you wrote the program, the class, the assignment, and your TA's name.
- print: display text to the console
-
String
: represents a collection of letters, digits, or other characters that are strung together - whitespace: a term to describe characters that are 'invisible' on a screen, such as spaces, tabs, and new lines
Week 2: Data Types and Expressions; String
Methods, char
, and Variables¶
Data Types, Expressions, Operators¶
- boolean: a data type that represents either
true
orfalse
-
char
: a data type that represents a single character -
double
: a data type that represents decimal numbers - expression: a combination of values and operators that evaluates to a single value
-
int
: a data type that represents whole numbers - logical operators: a symbol used to evaluate an expression to
true
orfalse
(ex&&
,||
,!
) - modulo (mod): an operation that finds the remainder of division (
%
) - operator: a symbol that performs an operation on a value or variable (ex
+
,/
,%
, &&) - PMMDAS (a simplified order of operations):
- P - parenthesis
- MMD - modulo, multiplication, or division, whichever comes first (left to right)
- AS - addition or subtraction, whichever comes first (left to right)
- precedence: the order in which subexpressions of an expression are evaluated
- relational operators: a symbol used to compare two values and evaluate an expression to either
true
orfalse
(ex==
,<
,>=
) - subexpression: a portion of an expression that can be evaluated independently
- type: the kind of data specified for a value (ex:
int
,double
,String
)
Variables, Strings, Debugging¶
- assignment: a way to assign a value to a variable
- case-sensitive: distinguishes between uppercase and lowercase letters
- case-insensitive: does not distinguish between uppercase and lowercase letters
- declaration: a way to define a variable with a name and a data type
- index (pertaining to a
String
): the numerical position of a character in aString
- initialization: a way to store a value into a variable for the first time
- passing in: referring to the argument passed into the parentheses
- primitive: a type that is directly built into Java that always begin as a lowercase letter (ex
int
,boolean
,char
,double
) - substring: a portion of characters in a
String
, defined by a specific starting and ending position - variable: gives a name to a specific value
- zero-based indexing: the first character in a
String
is assigned an index of 0 (not 1)
Week 3: for
Loops and Nested for
Loops; the Random
Class¶
for
Loops and Nested for
Loops¶
- block: the code between two curly braces
- fenceposting: a programming technique used to handle scenarios where the first or last iteration of a loop requires special handling, such as avoiding extra characters or operations. Similar to building a fence with wires separated by posts, we want the fence to start and end with a post to avoid having an extra dangling wire at the end.
- Let's say we want to print "p-i-c-k-l-e-b-a-l-l" To prevent printing ā-p-i-c-k-l-e-b-a-l-lā, we can use fenceposting. First, print out the p. Next, starting at the second character in the String, print a dash and the character, one after the other, for every character in the String.
String word = "pickleball"; System.out.print(word.charAt(0)); for (int i = 1; i < word.length(); i++) { char letter = word.charAt(i); System.out.print("-" + letter); }
- Let's say we want to print "p-i-c-k-l-e-b-a-l-l" To prevent printing ā-p-i-c-k-l-e-b-a-l-lā, we can use fenceposting. First, print out the p. Next, starting at the second character in the String, print a dash and the character, one after the other, for every character in the String.
-
for
loop: a programming construct that repeats lines of code a set number of times - infinite loop: a loop that does not stop because the condition required for it to end is never met
- iterate: the act of repeating a process or set of steps until a condition is met, often within a loop
- iteration: a single instance of a repeated process
- nested
for
loop: a for loop placed inside another for loop; used when we need to repeat a task (inner loop) multiple times within another repetition (outer loop) - scope: the ability for different variables to be accessed, altered, and utilized within a particular part of a program; variables are typically only in scope within the curly braces that they were created inside
-
String
traversal: the process of accessing and processing each character in aString
one by one
Random
Class¶
- object*: a complex value that is typically created with the new keyword (in contrast to simple literal values) (ex
Random
) - pseudorandom numbers: a sequence of numbers that appear random, but are actually generated by mathematical formulas and algorithms
- pseudorandom number generator: a computer algorithm that generates pseudorandom numbers
- seed: a starting value used within the initialization of a pseudorandom number generator
Week 4: Methods, Parameters¶
- calling: a way to execute a method
- class constant: a variable whose value cannot be changed after assignment
- method: a block of code that allows us to define our own commands and compartmentalize our code
- method body: the block of code enclosed within two curly braces of a method
- method comment: a high-level comment that describes a method
- See the Commenting Guide for more information!
- parameter: the input that a method can receive and use throughout its body; parameters appear in a specific order and have a type
Week 5: Returns, Conditionals¶
- return: the process of sending a value from a method back to the caller using a
return
statement - return type: the type of value that a method is expected to return, as specified in its definition (ex
int
,double
,String
) - void: a type that represents nothing; a method with a void return type returns nothing
- boolean zen: the act of directly comparing a boolean value equal to
true
orfalse
within a conditional, which is improper code quality- See the Code Quality Guide for more information!
- conditional: a control structure that allows a program to conditionally execute a block of code based on whether a specific condition is
true
orfalse
-
if
statement: a control structure that executes a block of code only if a specified condition evaluates totrue
-
else if
block: a control structure that is an optional part of anif
statement; it provides an additional condition to check if the previous condition evaluated tofalse
-
else
block: a control structure that is a final, optional part of anif
statement that executes a block of code if none of the preceding conditions weretrue
Week 6: while
Loops; User Input (Scanner
); Boolean Zen¶
- definite loop: a loop where the number of iterations is known (traditionally a
for
loop) - indefinite loop: a loop where the number of iterations is unknown and runs until a certain condition is met (ex:
while
loops) -
Scanner
: an object that is used to read user input - token: a unit comprised of one or more non-whitespace characters
-
while
loop: a programming construct that repeats lines of code until a certain condition is met
Footnotes¶
* This is a topic that is not covered deeply in CSE 121. However, you’ll revisit this idea in-depth in CSE 122 & 123.
Acknowledgements¶
This iteration of the glossary was developed by Hannah Swoffer, Maitreyi Parakh, and Sushma Shankar. This is based on a prior glossary written by Hannah Swoffer and Trey Adams.