Verityprep
Question Bank

AP® Computer Science A Multiple Choice Questions

Work through AP Computer Science A multiple-choice questions unit by unit, 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 2,191–2,200 of 2,811
  1. 2191
  2. 2192
  3. 2193
  4. 2194
  5. 2195
  6. 2196
  7. 2197
  8. 2198
  9. 2199
  10. 2200

Question 2191

Multiple choice Unit 4: Data Collections
public class TimeRecord { private int hours; private int minutes; // 0<=minutes<60 public TimeRecord(int h, int m) { hours = h; minutes = m; } /** @return the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2192

Multiple choice Unit 4: Data Collections
Consider the following instance variable and method. private int[] arr; /** Precondition: arr contains no duplicates; * the elements in arr are in sorted order.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2193

Multiple choice Unit 4: Data Collections
Consider the following instance variable and method findLongest with line numbers added for reference. Method findLongest is intended to find the longest…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2194

Multiple choice Unit 4: Data Collections
Consider the following instance variable and method findLongest with line numbers added for reference. Method findLongest is intended to find the longest…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2195

Multiple choice Unit 4: Data Collections
Consider the following instance variable and method. private int[] myStuff; /** Precondition: myStuff contains int values in no particular order. */ public int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2196

Multiple choice Unit 4: Data Collections
Consider the following method. / * * @param x x >= 0 * / public void mystery(int x) { System.out.print(x % 10); if ((x / 10)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2197

Multiple choice Unit 4: Data Collections
Consider the following recursive method. public static int mystery(int n) { if (n == 0) return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2198

Multiple choice Unit 4: Data Collections
Consider the following instance variable and method. private int[] arr; /** Precondition: arr.length > 0 */ public int checkArray() { int loc = arr.length /…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2199

Multiple choice Unit 4: Data Collections
Consider the following code segment. int[][] mat = new int[3][4]; for (int row = 0; row < mat.length; row++) { for (int col = 0; col < mat[0].length; col++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2200

Multiple choice Unit 4: Data Collections
Consider the following methods. public List<Integer> process1(int n) { List<Integer> someList = new ArrayList<Integer>(); for (int k = 0; k < n; k++)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,191 of 2,811
Page 220 of 282