1/21
Vocabulary and key concepts from the Chapters 1-3 Review Guide, covering error types, Java conventions, data types, and operators.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Syntax error
An error reported by the compiler that prevents the program from compiling or executing.
Run-time error
An error that occurs when a program has compiled and is running, but then terminates abnormally.
Logical error
An error where the program finishes execution but produces incorrect results.
Identifier Rules
Naming rules stating only letters, digits, underscores (_), and dollar signs ($$) are allowed; identifiers cannot start with a digit or be a Java key word.
Java variable naming convention
Variables should start with a lower case letter, use nouns, and capitalize subsequent words with no spaces instead of using underscores (_).
byte
An integer data type that uses 1 byte (8 bits) of space.
short
An integer data type that uses 2 bytes (16 bits) of space.
int
An integer data type that uses 4 bytes (32 bits) of space.
long
An integer data type that uses 8 bytes (64 bits) of space.
float
A real value data type that uses 4 bytes (32 bits) of space.
double
A real value data type that uses 8 bytes (32 bits) of space.
Assignment operator
The operator symbol = used to assign values to variables.
Augmented assignment operators
Short-cut operators including +=,−=,∗=,/=, and %=.
Increment and decrement operators
The operators ++ and −− which are equivalent to adding or subtracting 1 from a variable.
% (mod) operator
The arithmetic operator used to find the remainder of a division, such as 28%10 resulting in 8.
Implicit data type conversion
The process where a smaller data type is automatically converted to a bigger type during an operation, such as an int being converted to a long before addition.
Type cast
A manual conversion needed to convert a bigger type to a smaller type, such as (int)5.6; it has very high priority over arithmetic operators.
Logical operator constraints
Operators like ! and && must operate on boolean values; using them on types like int will generate a syntax error.
If statement syntax
A control structure that requires parentheses () around the boolean expression to be valid.
Dangling else rule
In nested logic, an else clause always matches the closest preceding if statement that does not already have an else.
Scanner class
A utility found in java.util.Scanner used to get user inputs such as int, double, and String values.
nextInt(), nextDouble(), and next()
Specific methods on a Scanner object used to capture integer, double, and String user inputs respectively.