Verityprep
Question Bank · Unit 4

AP® Computer Science A Data Collections Practice Questions

Work through AP Computer Science A practice 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.

Subtopic: Arraylists Clear filter

Questions 41–50 of 225
  1. 41
  2. 42
  3. 43
  4. 44
  5. 45
  6. 46
  7. 47
  8. 48
  9. 49
  10. 50

Question 41

Multiple choice Arraylists
The method should return the matching string’s index or−1. Which repair is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 42

Multiple choice Arraylists
Which change makes this selection sort order values from greatest to smallest? public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 43

Multiple choice Arraylists
How often does curIndex-- execute for insertionSort(new int[]{6,5,4,3,2,1})? public static int[] insertionSort(int[] arr) { for(int i=1;i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 44

Multiple choice Arraylists
Which inputs demonstrate that this attempted even-number removal is incorrect?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 45

Multiple choice Arraylists
What happens? ArrayList list=new ArrayList () list.add(5);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 46

Multiple choice Arraylists
What does numbers contain afterward? ArrayList numbers=new ArrayList () numbers.add("one");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 47

Multiple choice Arraylists
Starting from [2,4,5,6,8], which replacement safely…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 48

Multiple choice Arraylists
Consider the following code segment. ArrayList<String> numbers = new ArrayList<String>(); numbers.add("one"); numbers.add("two"); numbers.add(0, "three");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 49

Multiple choice Arraylists
Consider the following method, which is intended to return a list containing the elements of the parameter myList with all even elements removed. public static…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 50

Multiple choice Arraylists
Consider the following method, which is intended to print the ArrayList names in reverse order. public static void printInReverseOrder(ArrayList<String> names)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 41 of 225
Page 5 of 23