Verityprep
Question Bank · Unit 1

AP® Computer Science A Using Objects and Methods Practice Questions

Work through AP Computer Science A practice 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 521–530 of 546
  1. 521
  2. 522
  3. 523
  4. 524
  5. 525
  6. 526
  7. 527
  8. 528
  9. 529
  10. 530

Question 521

Multiple choice Using Objects
What is printed? String value = null;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 522

Multiple choice Using Objects
What is printed? String a = "go"; String b = a; a = null;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 523

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 524

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 525

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 526

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 527

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 528

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 529

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 530

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 521 of 546
Page 53 of 55