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 141–150 of 2,811
  1. 141
  2. 142
  3. 143
  4. 144
  5. 145
  6. 146
  7. 147
  8. 148
  9. 149
  10. 150

Question 141

Multiple choice Unit 1: Using Objects and Methods
What will the following code output when executed? String breakfast = new String("Pizza"); String lunch = new String("Pizza"); String dinner = breakfast; if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 142

Multiple choice Unit 1: Using Objects and Methods
The following code is intended to return only even numbers. If an even number is passed to the method, it should return that number. If an odd number or zero is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 143

Multiple choice Unit 1: Using Objects and Methods
Given the following statements, which options will print true? String ursa = new String("2849"); String major = new String("2849"); I.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 144

Multiple choice Unit 1: Using Objects and Methods
The following method is designed to return true if the passed phrase contains either the word cat or dog. public boolean containsPet(String input){ if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 145

Multiple choice Unit 1: Using Objects and Methods
What will the following code output when executed? String word = "elementary"; if (word.length() > 8) { System.out.println("Long Word"); } if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 146

Multiple choice Unit 1: Using Objects and Methods
Evaluate the mathematical…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 147

Multiple choice Unit 1: Using Objects and Methods
Which of the following successfully switches the integer values of the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 148

Multiple choice Unit 1: Using Objects and Methods
What is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 149

Multiple choice Unit 1: Using Objects and Methods
What does this method call output? public double doubleOrNothing(double…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 150

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. int a = 5; int b = 2; double c = 3.0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 141 of 2,811
Page 15 of 282