A datatype that would be used to store a whole number value.
What is an int?
A loop best used for iterating an arbitrary number of times.
What is a while loop?
The keyword used to return data from a function in Java.
What is return?
The variable/property used to find the size of an array in Java.
What is length?
A line of code that creates a variable called age and stores the value of 17 to it.
What is int age = 17;?
A datatype that can store true or false values.
What is a bool or boolean?
A keyword to test a condition before executing a block of code.
What is if?
One of the two keywords that we usually type when defining a method in Java.
What is an access modifier (either public or private) or static?
An item stored inside an array.
What is an element?
A conditional that checks if both weekend and holiday are true before printing "Too bad the holiday landed on a weekend this year."
System.out.println("Too bad the holiday landed on a weekend this year.");
}?
A datatype to store a sequence of characters.
What is a String?
A loop best used for iterating a specific number of times.
What is a for loop?
The keyword that signifies a method does not have a return value.
What is void?
The symbols used to index into an array.
What are square brackets []?
A for loop that prints numbers 20-2, counting down by 2s.
What is for (int i = 20; i >=2; i -= 2) {
System.out.println(i);
}?
A datatype that stores a single character.
What is a char?
A keyword that is used to end execution of a loop.
What is break?
A variable that is declared as part of the method's declaration and is assigned a value when the function is called.
What is a parameter?
The keyword you find directly after the assignment operator when initializing an empty array.
What is new?
The definition for a function that returns type double, is called "half" and takes an int parameter called "num." The function returns half of the num parameter.
What is [public static] double half(int num) {
return num / 2;
}
Datatypes that are built into the language and (in Java) start with a lowercase letter.
What are primitive datatypes?
The keyword used to handle the condition where no other case matches in a switch statement.
What is default?
The term used to define the area of a program where an item (usually a variable) can be recognized.
What is scope?
A type of loop that is best used when we only really care about retrieving the value of array elements.
What is a for each loop?
A for each loop that iterates over an int array called "myNumbers" and prints out each element + 5.
for (int element : myNumbers) {
System.out.println(element + 5);
}