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,201–2,210 of 2,811
  1. 2201
  2. 2202
  3. 2203
  4. 2204
  5. 2205
  6. 2206
  7. 2207
  8. 2208
  9. 2209
  10. 2210

Question 2201

Multiple choice Unit 4: Data Collections
Consider the following instance variable and incomplete method, partialSum, which is intended to return an integer array sum such that for all i, sum[i] is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2202

Multiple choice Unit 4: Data Collections
What is printed? Assume java.util.ArrayList has been imported. public class Java1102 { public static void main(String[] args) { ArrayList names=new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2203

Multiple choice Unit 4: Data Collections
Consider this program segment. You may assume that wordList has been declared as ArrayList<String>. for (String s :…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2204

Multiple choice Unit 4: Data Collections
Refer to the following method. public static int mystery(int n) { if (n == 1)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2205

Multiple choice Unit 4: Data Collections
Refer to the following declarations. String[] colors = {"red", "green", "black"}; ArrayList<String> colorList = new ArrayList<String>(); Which of the following…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2206

Multiple choice Unit 4: Data Collections
Often the most efficient computer algorithms use a divide-and-conquer approach, for example, one in which a list is repeatedly split into two pieces until a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2207

Multiple choice Unit 4: Data Collections
Refer to method removeWord. /** Removes all occurrences of word from wordList. /** Precondition: wordList is an ArrayList of String objects. * Postcondition:…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2208

Multiple choice Unit 4: Data Collections
A Clock class has hours, minutes, and seconds represented by int values. It also has each of the following methods: setTime to change the time on a Clock to the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2209

Multiple choice Unit 4: Data Collections
Consider the following method that will access a square matrix mat. /** Precondition: mat is initialized and is a square matrix. */ public static void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2210

Multiple choice Unit 4: Data Collections
Consider two different ways of storing a set of nonnegative integers in which there are no duplicates. Method One: Store the integers explicitly in an array in…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,201 of 2,811
Page 221 of 282