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 111–120 of 3,140
  1. 111
  2. 112
  3. 113
  4. 114
  5. 115
  6. 116
  7. 117
  8. 118
  9. 119
  10. 120

Question 111

Multiple choice Unit 1: Using Objects and Methods
Consider the following class: public class RaffleTicket { private String ownerName; private int ticketNum; public RaffleTicket(String name) { ownerName = name;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 112

Multiple choice Unit 1: Using Objects and Methods
Consider the following class: public class RandomCalculator { private int x; private int y; public RandomCalculator(int one, int two) { x = one; y = two; }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 113

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: String str = "I am"; str += 10 + 3; String age = "years…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 114

Multiple choice Unit 1: Using Objects and Methods
Which of the following code segments would correctly assign word from the String sentence = "Grab the last word" to the variable lastWord? I. String lastWord =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 115

Multiple choice Unit 1: Using Objects and Methods
Consider the following class: public class Greetings { private String greetings; public Greetings(String greeting) { greetings = greeting;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 116

Multiple choice Unit 1: Using Objects and Methods
A science teacher wants to create an Elements class for the Periodic Table. They want to include several attributes to the Elements class: the atomic weight,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 117

Multiple choice Unit 1: Using Objects and Methods
Which of the following will execute…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 118

Multiple choice Unit 1: Using Objects and Methods
Consider the following method. public void processString (String str) { str = str.substring(2, 3) + str.substring(1, 2) + str.substring(0, 1); } What is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 119

Multiple choice Unit 1: Using Objects and Methods
Given String str = "RETRIEVER"; int index =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 120

Multiple choice Unit 1: Using Objects and Methods
Consider the mystery method below. public static String mystery(String str1, String str2) { int index =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 111 of 3,140
Page 12 of 314