Arrays
Loops
Conditional Statements
Strings
Miscellaneous
100

This is the type of variable for the following line of code:

int[] numbers= new int[15];

What is an int array?

100

This is the value stored in k at the end of this loop.

int k=0;

for(int i=0;i<10;i++)k*=5;

What is 0?

100
These are the two values for a conditional statement.

What are true and false?

100

This is the memory location that a new String() is stored in.

What is the heap?

100

This is the line of code to create a Scanner object named inputStream that will be used to get input from the console.

What is

Scanner inputStream = new Scanner(System.in);

?

200

This is the number stored in len in the following code.

char[] letters = {'a','b','c','d','e','f','g','h','i'};

int len = letters.length;

What is nine?

200

This is the number of times "and then" is printed out.

for(int i=1; i<100; i*=2)

System.out.println("and then");

What is seven?

200

This is the conditional statement that will make this for-loop execute 3 times.

for(int i=3; /*conditional statement*/; i--){...}

What is i>0?

or

What is i>=1?

or

What is i!=0?

200

This is the segment of code to get the last character in a String called word of unknown length.

What is

word.charAt(word.length()-1)

?

200

This is they keyword used for a method that must be defined when inherited by another class. Hint: you put @Override above the definition.

What is abstract?

300

This is the line of code to print what is in the first index of following array on its own line:

String[] sentence={...};

What is

System.out.println(sentence[0]);

?

300

This is the for-loop that initializes odds to the first 57 odd numbers.

int[] odds= new int[57];

//for loop here

odd[k]=k*2+1;

What is

for(int k = 0; k<57; k++)

?

300

This conditional statement cause the do-while loop to execute until the user provides a 5-character string.

Scanner userInput=new Scanner(System.in);

String word;

do{

word=userInput.nextLine();

while(/*conditional statement*/);

What is word.length()!=5 ?

300

This is the segment of code to compare the String left with the String right to see if they "look" the same.

What is 

left.equals(right)

?

300

This is the line of code that will clear the buffer of the Scanner object called notEmpty.

What is 

notEmpty.nextLine();

?

400

This is what is missing in the loop to make each index of empty a new Hole using the default constructor.

Hole[] empty = new Hole[15];

for(int i = 0; i < Hole.length; i++}

//Missing

What is

Hole[i]=new Hole();

?

400

This is the line inside the for-loop that saves each index of left into right in the opposite order.

String[] left = {...};

String[] right = new String[left.length];

for(int b=0; b<left.length; b++)

//line to save indices in opposite order

What is

right[b]=left[left.length-b-1];

?

400

This is the values for a and b that make this conditional statement false.

int a, b;

...

if(a<b||a>b){...}

What is when a is equal to b?

400

This is the line of code to initialize a String called space to have only 3 new line characters in it.

What is

String space = "\n\n\n";

?

400

This is the name of the list of variables in a method definition.

What is the parameter list?

500

Once an array is created and initialized, you may no longer change this.

What is the length of the array?

500

This is the number of times the following loop will print "okay".

for(int i=0; i<100; i++){

if(i%5==3)System.out.println("okay");

if(i%5==4)i*=3;

}

What is 3?

500

This is the number of times the while loop will print "maybe".

int k = 10;

while((k>0)&&((k%2)!=1)){

System.out.println("maybe");

k++;

}

What is one?

500

This is the line of code to take the String echo and turn it into two consecutive copies of echo.

What is 

echo+=echo;

or

echo = echo+echo;

?

500

This is the name of the metaphor we used to describe how JavaFX interacts with new windows.

What is the theater metaphor?