Verityprep
Question Bank · Unit 1

AP® Computer Science A Using Objects and Methods Multiple Choice Questions

Work through AP Computer Science A multiple-choice questions on Using Objects and Methods, 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 681
  1. 141
  2. 142
  3. 143
  4. 144
  5. 145
  6. 146
  7. 147
  8. 148
  9. 149
  10. 150

Question 141

Multiple choice Using Objects
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 Using Objects
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 Using Objects
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 Using Objects
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 Using Objects
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 Primitive Types
Evaluate the mathematical…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 147

Multiple choice Primitive Types
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 Using Objects
What is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 149

Multiple choice Using Objects
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 Primitive Types
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 681
Page 15 of 69