Verityprep
Question Bank

AP® Computer Science A Practice Questions

Work through AP Computer Science A practice 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,411–2,420 of 3,140
  1. 2411
  2. 2412
  3. 2413
  4. 2414
  5. 2415
  6. 2416
  7. 2417
  8. 2418
  9. 2419
  10. 2420

Question 2411

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 2412

Free response Unit 4: Data Collections
This question involves a two-dimensional array of integers that represents a collection of randomly generated data. A partial declaration of the Data class is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2413

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 2414

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 2415

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 2416

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 2417

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 2418

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 2419

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 2420

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 2,411 of 3,140
Page 242 of 314