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 491–500 of 546
  1. 491
  2. 492
  3. 493
  4. 494
  5. 495
  6. 496
  7. 497
  8. 498
  9. 499
  10. 500

Question 491

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 492

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 493

Multiple choice Using Objects
The String s may be empty. The assignment should remove one outer pair of square brackets only when s begins with "[" and ends…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 494

Multiple choice Using Objects
The loop should keep one character from each consecutive run. For example, "aabbaa" must become "aba". Which condition correctly fills the blank for every text,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 495

Multiple choice Using Objects
The String original may contain any number of letters, including zero. Which expression is guaranteed to be true before the loop and after every…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 496

Multiple choice Using Objects
What is printed? String s = "baaaabb"; for (int i = 0; i < s.length() - 1; i++) { if (s.substring(i, i +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 497

Multiple choice Using Objects
What is printed? String a = "xy"; String b = "xyxy";…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 498

Multiple choice Using Objects
The expressions below are both true. Which additional expression…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 499

Multiple choice Using Objects
What is printed? String s = "ABCD"; String t = s; s = t.substring(1);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 500

Multiple choice Using Objects
The int k may be 0, 1, 2, or 3. Which list gives all values of k for which result…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 491 of 546
Page 50 of 55