For Loop
Errors in Java
Boolean
Code Structure
Arithmetic
100

What is the proper term for --

When used with a variable, it decreases the variable by one. Usually used to keep decreasing a loop by one.

decrement operator

100

What is one of the most common ArithmeticExceptions in Java?

dividing a number by 0

100

Name the 3 logical operators and their symbols used to compare Booleans

!      Not

&&   And

||    Or

100

What is included when writing parameters?

parameter name and parameter type

100

What are the 5 types of arithmetic operators you can use in Java?

+ - / % *

addition, subtraction, multiplication, division, modulus

200

What is the name for a loop that iterates through all elements of a collection?

Hint: for (int value : arrayName)

for each loop or enhanced for loop

200

When is an IndexOutOfBoundsException occur?

is thrown when an index of some sort is out of range

200

What does this mean?

if ((x < y) && (p != q))

the test is only true if x is less than AND p is NOT equal to q

200

Name 4 keywords used in coding.

Think of words that you use consistently and mean the same thing each time regardless of where their used

public, private, class, void, return, static, final

200

When is floating-point division used? What type of variable must be used for this?

when you want the what's after the decimal recognized

recommended to use doubles

300

What is the number of times the following loop will be executed:

for(int j = 1; j <= 10; j++)

10

300

What is a word that applies to ALL of the following:

ArrayIndexOutOfBoundsException, ArithmeticException, NullPointerException

exception in Java
300

What does this mean? 

if((p == q) || (j >= 4))

test will be true if p is equal to q OR j is greater than or equal to 4

only one needs to be true for true result

300

What block of code is used to create an object of the class? It has no return type and cannot be invoked by a direct method call. It contains the order of parameters used to add value to object creation.

constructor

300

Solve the equation:

11 - 4 / 3 + 2

12

400

How many times is the following loop executed?

for(int j = 1; j <= 3; j++) 

{ for (int k = 1; k <= 2; k++) 

{ doSomething; } }

6

400

What kind of error occurs during compilation of a program, before execution starts?

compile time error

400

What is this code segment saying?

if (x == 3) { if ( y < 4 ) { /* action here */ }   }

the action will only happen if x is equal to 3 AND y is less than 4

400

What does the word final in the following code mean?

final int CLASS_SIZE = 25;

class size is set to 25 and cannot be changed

400

Solve this equation

3 + 4 * 8 / 3 - 12

1

500

How many times is this nested loop executed?

for (int j = 0; j < 5; j++)

{ for (int k = 1; k < 9; k++)

{ doSomething(); } }

40

500

What kind of error occurs when index is outside the range of the array?

ArrayIndexOutOfBoundsException

500

What is another way to write this equation?

if (m <= 20) { if ( n % 2 == 0 ) { /* action here */ }   }

if (m <= 20 && n % 2 == 0)

500

What are the keyword relationship for getter methods and setter methods?

getter: get and return

setter: set, void, variable = parameter

500
Solve this equation

(3 + 4) * 8 / 3 - 12