Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Practice Questions

Work through AP Computer Science A practice questions on Data Collections, then check each answer against a worked solution.

Free · no sign-up Open questions need no account. Sign up or log in to open the rest.

Questions 91–100 of 1,222
  1. 91
  2. 92
  3. 93
  4. 94
  5. 95
  6. 96
  7. 97
  8. 98
  9. 99
  10. 100

Question 91

Multiple choice Arrays
What value will be held in mysteryNumber when this code finishes running? int mysteryNumber = 0; String[] mysteryArray =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 92

Multiple choice Arrays
What will the Array gameBoard contain after this code runs? int WIDTH = 3; int HEIGHT = 3; String[] gameBoard = new String[WIDTH * HEIGHT]; for(int m = 0; m <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 93

Multiple choice Arrays
Given the following values of arr and the mystery method, what will the values of arr be after you execute: mystery()? private…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 94

Multiple choice Arrays
The following codes are intended to add 5 to each item in the array. I. int[] numbers = {1, 2, 3, 4}; for (int i = 0;i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 95

Multiple choice Arrays
What does the following code do when executed? int[] highTemp = {88, 92, 94, 90, 88, 83}; int target = 90;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 96

Multiple choice Arrays
The method should detect equal adjacent elements. Which changes are needed? I: initialize…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 97

Multiple choice Arrays
What will print out when the following code executes? int[] nums = {1, 2, 3, 4, 5, 6}; int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 98

Multiple choice Arrays
What does the following code snippet output? int[] numbers = {1, 2, 3, 4, 5}; int[] temp = new int[numbers.length]; for (int i = 0;i < numbers.length - 1;i++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 99

Multiple choice Arrays
What does the following code snippet check for? int[] numbers = {1, 2, 3, 3, 4, 5}; boolean mysteryBoolean = false; for (int i = 0;i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 100

Multiple choice Arrays
What does the following code snippet do? int[] scores = {80, 92, 91, 68, 88}; int sum = 0; for (int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 91 of 1,222
Page 10 of 123