RECALL

1️⃣

for (String 2️⃣ : passwords) {
	System.out.println(currPassword);
}

What needs to go into 1️⃣ and 2️⃣for this code to compile?

RECALL

Here is some code:

String result = "";

for (String currLetter : letters) {
	result += currLetter;
}

System.out.println(result);

Assume the ArrayList<String> letters contains these strings:

"1" "2" "3"

What will appear in the console when the code is run?

RECALL

Here is some code:

Scanner numScanner = new Scanner("124 200");

int num = numScanner.nextInt();
while (num % 100 != 0) {
    System.out.println("ping!");
}

System.out.println("Done!");

What is displayed when this code runs?

lecture-05 (week-03-R)

By Jordan Pratt

lecture-05 (week-03-R)

  • 54