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.

Subtopic: Using Objects Clear filter

Questions 431–440 of 454
  1. 431
  2. 432
  3. 433
  4. 434
  5. 435
  6. 436
  7. 437
  8. 438
  9. 439
  10. 440

Question 431

Multiple choice Using Objects
What happens when the code executes? String s = null; if (s == null || s.length()…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 432

Multiple choice Using Objects
s may be null or empty. Which condition safely accepts…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 433

Multiple choice Using Objects
What is printed? String s = "ABCDE"; int count = 0; for (int i = 0; i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 434

Multiple choice Using Objects
Which offered initial value of s makes this loop continue forever? while…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 435

Multiple choice Using Objects
What is printed? String text = "abaca"; String out = ""; for (int i = 0; i < text.length(); i++) { String ch =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 436

Multiple choice Using Objects
What does count represent after the loop for every String text? int count = 0; for (int i = 0; i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 437

Multiple choice Using Objects
s may be empty. Which expression is guaranteed to be true after the loop? String out =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 438

Multiple choice Using Objects
s is initially nonempty. Which list gives all initial lengths of s for which cuts…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 439

Multiple choice Using Objects
What is printed? String s = "ababa"; int total = 0; for (int i = 0; i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 440

Multiple choice Using Objects
n is s.length(), and 0 <= k <= n. Which expression reconstructs the original s from rotated for…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 431 of 454
Page 44 of 46