2D ARRAYS
LOOPS
Debugging
String Methods
100

 In Java, what is the outer index value on the first iteration of the outer loop when running a nested iteration statement?

what is "Zero."

100

How do you add 1 to the index each time the loop is run.

What is "i++"

100

A _________________________ is an error caused by a grammatical error in the code, stopped by the compiler

What is "a syntax error?"

100

Which method would you use to find the length of a string?

what is "len()"

200

 In Java, how do you declare a 2D array of integers named matrix?

what is "declare it with two sets of square brackets."

200

this kind of loop executes as long as the condition is met.

What is a "While" loop

200

A _________________________ is an error caused by a program trying to make to computer do something it cannot, such as dividing by zero.

What is "a run time error?"

200

 Which method would you use to replace all occurrences of "cat" with "dog" in a string?

what is "replace()"

300

 In Java, how do you access the value 6 in a 2D array?

using this code

int[][] arr = {{1, 2, 3}, {4, 5, 6}}; // Accessing the value 6 int value = arr[1][2]; System.out.println("The value is: " + value);


What is "access it using row 1, column 2."

300

This keyword ends a loop no matter if the condition is met or not.

what is a "Break" keyword

300

A ________________________ is an error when the program functions but does not give the desired output.

What is "a logic error?"

300

returns the string value converted to uppercase?

What is "toUpperCase()"

400

 In Java, how do you modify the element in the third row and third column of a 2D array to 100.5?

What is "set the value at row 2, column 2 to 100.5."

400

This loop executes one loop for a specific number of times.

What is a "For" loop

400

A ___________/____________ can be used to handle exceptions.

 What is "a try/catch statement"

400

returns the string value converted to lowercase?

what is "toLowerCase()"


500

In Java, how do you write a nested loop to traverse a 2D array in column-major order?

What is "use a loop for columns on the outside and a loop for rows on the inside."

500

This loop makes sure at least one execution of the loop body before checking the condition.

What is a "Do-While" loop.

500
  1. This code should print out multiples of two between 1 and 100, what is wrong? 

public class Main{ 

public static void main(String[] args){ 

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

System.out.println(i); 

What is "Change the i ++ to i = i + 2"

500

This method concatenates one string to the end of another string?

what is "concat()"

M
e
n
u