Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Multiple Choice Questions

Work through AP Computer Science A multiple-choice 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 831–840 of 1,079
  1. 831
  2. 832
  3. 833
  4. 834
  5. 835
  6. 836
  7. 837
  8. 838
  9. 839
  10. 840

Question 831

Multiple choice Arraylists
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 832

Multiple choice Arrays
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 833

Multiple choice 2D Arrays
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 834

Multiple choice Arraylists
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 835

Multiple choice Using Text Files
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 836

Multiple choice 2D Arrays
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 837

Multiple choice Arrays
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 838

Multiple choice Arraylists
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 839

Multiple choice 2D Arrays
What is printed? int[][] m = {{2,7,6}, {9,5,1}, {4,3,8}}; int sum = 0; for (int i = 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 840

Multiple choice Arrays
What does arr contain after the following code? int[] arr = {5, 2, 8, 1, 9, 3}; for (int i = 0; i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 831 of 1,079
Page 84 of 108