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,561–2,570 of 2,811
  1. 2561
  2. 2562
  3. 2563
  4. 2564
  5. 2565
  6. 2566
  7. 2567
  8. 2568
  9. 2569
  10. 2570

Question 2561

Multiple choice Unit 4: Data Collections
An ArrayList<Integer> named list contains [2, 4, 6, 8, 10]. The following loop runs: for (int i = 0; i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2562

Multiple choice Unit 4: Data Collections
Consider the following code that processes a 2D array: int[][] g = {{1,2,3},{4,5,6},{7,8,9}}; int total = 0; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2563

Multiple choice Unit 4: Data Collections
Consider a method that takes an ArrayList<String> and returns a new ArrayList…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2564

Multiple choice Unit 4: Data Collections
What is the output of the following code? int[] arr = {3, 1, 4, 1, 5, 9, 2, 6}; int count = 0; for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2565

Multiple choice Unit 4: Data Collections
A method receives a 2D integer array and returns true…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2566

Multiple choice Unit 4: Data Collections
What is the output of the following? ArrayList<Integer> a = new ArrayList<>(); for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2567

Multiple choice Unit 4: Data Collections
A file numbers.txt contains one integer per line. Which code segment correctly reads all integers and finds the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2568

Multiple choice Unit 4: Data Collections
A method receives a 2D array int[][] m where all rows have…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2569

Multiple choice Unit 4: Data Collections
The following method is supposed to shift all elements of an array one position to the left, with the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2570

Multiple choice Unit 4: Data Collections
What does list contain after the following loop? ArrayList<Integer> list = new ArrayList<Integer>(); list.add(3); list.add(1);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,561 of 2,811
Page 257 of 282