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.

Questions 181–190 of 1,222
  1. 181
  2. 182
  3. 183
  4. 184
  5. 185
  6. 186
  7. 187
  8. 188
  9. 189
  10. 190

Question 181

Multiple choice Arraylists
Which declares an ArrayList myTemps…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 182

Multiple choice Arraylists
What does nums contain afterward? ArrayList nums=new ArrayList () nums.add(10); nums.add(20);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 183

Multiple choice Arraylists
What does scales contain afterward? ArrayList scales=new ArrayList () scales.add("DO"); scales.add("RE"); scales.add("MI") scales.add("FA"); scales.add("SO")…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 184

Multiple choice Arraylists
What is printed? ArrayList nums=new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 185

Multiple choice Arraylists
What is printed? ArrayList list=new ArrayList () list.add("One"); list.add("Two");…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 186

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 187

Multiple choice Sorting And Searching
For nums=[1,2,4,3,4,5], what does search(nums,4) return? public int search(ArrayList list,int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 188

Multiple choice Sorting And Searching
For [6,5,4,3,2,1], how often does the counted statement execute? public static…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 189

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 190

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 181 of 1,222
Page 19 of 123