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 611–620 of 681
  1. 611
  2. 612
  3. 613
  4. 614
  5. 615
  6. 616
  7. 617
  8. 618
  9. 619
  10. 620

Question 611

Multiple choice Using Objects
The non-null Strings a and b have already been declared. Each offered declaration is…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 612

Multiple choice Using Objects
What is printed? String a = "elm"; String b = "oak"; String result = "?"; if (a.compareTo(b) < 0)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 613

Multiple choice Using Objects
Which offered value of text makes count equal to 2? int count = 0; for (int i = 1; i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 614

Multiple choice Using Objects
What is printed? String text = "A2B4C"; String digits = "0123456789"; int total = 0; for (int i = 0; i < text.length(); i++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 615

Multiple choice Using Objects
What is printed? String text = "aaaaa"; int hits = 0; for (int i = 0; i <= text.length() - 2;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 616

Multiple choice Using Objects
What is printed? String s = "ab"; while (s.length() < 7) { s +=…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 617

Multiple choice Using Objects
What is printed? String s = "aababb"; int removed = 0; while (s.indexOf("ab") != -1) { int p =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 618

Multiple choice Using Objects
What is printed? Each position range is counted separately, even if two ranges contain the same text. String s = "aba"; 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 619

Multiple choice Using Objects
Each entry has a three-letter lowercase name, a colon, and a two-digit code, such as "oak:27". Larger codes are preferred;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 620

Multiple choice Using Objects
Initially, 0 <= p <= text.length(), and marker is nonempty. The first assignment inserts marker at p. Which statement makes the second assignment insert "|"…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 611 of 681
Page 62 of 69