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 1,841–1,850 of 2,811
  1. 1841
  2. 1842
  3. 1843
  4. 1844
  5. 1845
  6. 1846
  7. 1847
  8. 1848
  9. 1849
  10. 1850

Question 1841

Multiple choice Unit 4: Data Collections
The two versions of the search method shown below are both intended to return true if ArrayList<Object> list contains the target value; otherwise they are…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1842

Multiple choice Unit 4: Data Collections
Consider the following recursive method. public static void printSomething(int n) { if (n…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1843

Multiple choice Unit 4: Data Collections
Consider the following method. /** Returns the index of searchVal, if found in list; * otherwise returns -1 */ public int binarySearch (ArrayList<String> list,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1844

Multiple choice Unit 4: Data Collections
int[][] t = new int[2][3]; for (int i = 0; i < t.length; i++) { for (int j = 0; j <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1845

Multiple choice Unit 4: Data Collections
What is the outcome when the following code is compiled/executed? ArrayList<Integer> numbers = new ArrayList<Integer>();…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1846

Multiple choice Unit 4: Data Collections
Consider the following class. public class Matrix { private int[][] m; /** Initializes m to a square n-by-n array with all * the elements on the diagonal…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1847

Multiple choice Unit 4: Data Collections
Consider the following code segment. ArrayList<Integer> list = new ArrayList<Integer>(); list.add(1); list.add(2); for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1848

Multiple choice Unit 4: Data Collections
Consider the following method. public void reduce(int[] arr, int len) { for (int k = 0; k < len; k++) { arr[k]--; } len--; } What is printed when the following…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1849

Multiple choice Unit 4: Data Collections
How do you create an…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1850

Multiple choice Unit 4: Data Collections
What is a primary difference…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1,841 of 2,811
Page 185 of 282