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,081–2,090 of 2,811
  1. 2081
  2. 2082
  3. 2083
  4. 2084
  5. 2085
  6. 2086
  7. 2087
  8. 2088
  9. 2089
  10. 2090

Question 2081

Multiple choice Unit 4: Data Collections
list is ArrayList with [2,5,7,6,0,1].…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2082

Multiple choice Unit 4: Data Collections
list is nonempty and sorted in decreasing string order. When does insert fail? public void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2083

Multiple choice Unit 4: Data Collections
If list initially contains [6,1,8], what does it…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2084

Multiple choice Unit 4: Data Collections
Assume coins contains nonnull Coin objects. Which replaces /* more code */ in getTotal? public class Coin { private double value private String name public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2085

Multiple choice Unit 4: Data Collections
In Purse.find, coins and aCoin are nonnull. Coins with the same name have the same value, and vice versa. Which replacement detects a match? public class Coin {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2086

Multiple choice Unit 4: Data Collections
Which initializes an8×10 int matrix with all entries perfect squares, including 0? I int[][] mat=new int[8][10]; II int[][] mat=new int[8][10]; for(int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2087

Multiple choice Unit 4: Data Collections
Consider the following code segment. int[][] mat = {{1,3,5}, {2,4,6}, {0,7,8}, {9,10,11}}; for (int col = 0; col < mat[0].length; col++) for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2088

Multiple choice Unit 4: Data Collections
Consider a class that has this private instance variable. private int[][] mat; The class has the following method, alter. public void alter(int c) { for (int i…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2089

Multiple choice Unit 4: Data Collections
Consider the following method that will alter the matrix mat. public static void matStuff(int[][] mat, int row) { int numCols = mat[0].length; for (int col…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2090

Multiple choice Unit 4: Data Collections
Assume that a square matrix mat is defined by int[][] mat = new int[SIZE][SIZE]; // SIZE is an integer constant >= 2 What does the following code segment do?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 2,081 of 2,811
Page 209 of 282