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 391–400 of 454
  1. 391
  2. 392
  3. 393
  4. 394
  5. 395
  6. 396
  7. 397
  8. 398
  9. 399
  10. 400

Question 391

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 392

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 393

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 394

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 395

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 396

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 397

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 398

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 399

Multiple choice Using Objects
Which offered value of start makes both checks print true? String route = "red::blue::gold"; String tail =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 400

Multiple choice Using Objects
The nonempty String needle occurs at least twice in text. Overlapping occurrences count. first is the start of the first…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 391 of 454
Page 40 of 46