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 401–410 of 454
  1. 401
  2. 402
  3. 403
  4. 404
  5. 405
  6. 406
  7. 407
  8. 408
  9. 409
  10. 410

Question 401

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 402

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 403

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 404

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 405

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 406

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 407

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 408

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 409

Multiple choice Using Objects
Which offered value of s makes same true? int middle = s.length() / 2;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 410

Multiple choice Using Objects
All indices make the expression below valid. Which expression always returns the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 401 of 454
Page 41 of 46