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,791–1,800 of 2,811
  1. 1791
  2. 1792
  3. 1793
  4. 1794
  5. 1795
  6. 1796
  7. 1797
  8. 1798
  9. 1799
  10. 1800

Question 1791

Multiple choice Unit 4: Data Collections
Which of the following is (are) true? I. Insertion sort takes longer when the array is sorted in ascending order and you want it sorted in…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1792

Multiple choice Unit 4: Data Collections
Given the following values for a 2D array m and the following code 1 1 1 1 1 2 3 4 2 2 2 2 2 4 6 8 int sum = 0; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1793

Multiple choice Unit 4: Data Collections
Given the following definition: int len = 4; int[][] matrix = new int[len][len]; Consider the following code: int total = 0; for (int row = 0;row < len;row++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1794

Multiple choice Unit 4: Data Collections
Consider the following field and method declarations. private List list; public void mystery(int n) { for (int i = 0; i Assume that list has been…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1795

Multiple choice Unit 4: Data Collections
Consider the following method. public static int recur(int n) { if (n <= 1) return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1796

Multiple choice Unit 4: Data Collections
Consider the following code segment. List<String> list = new ArrayList<String>(); list.add("a"); list.add("b"); list.set(1, "c");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1797

Multiple choice Unit 4: Data Collections
Given the following method and what would the result be when m is executed? public void m(int[][] p) { int height = p.length; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1798

Multiple choice Unit 4: Data Collections
What is the output from mystery(4321) when mystery is defined as follows: Precondition: \(x \geq 0\) public static…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1799

Multiple choice Unit 4: Data Collections
Given the following code which of the answers best describes the conditions needed for temp to be true when it is returned?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1800

Multiple choice Unit 4: Data Collections
Which replacement for /* missing code */ sorts a in ascending order? public static void sort(int[] a) { int maxCompare = a.length - 1 int savedIndex = 0 int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 1,791 of 2,811
Page 180 of 282