Verityprep
Question Bank

AP® Computer Science A Multiple Choice Questions

Work through AP Computer Science A multiple-choice questions unit by unit, 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 621–630 of 2,811
  1. 621
  2. 622
  3. 623
  4. 624
  5. 625
  6. 626
  7. 627
  8. 628
  9. 629
  10. 630

Question 621

Multiple choice Unit 1: Using Objects and Methods
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 622

Multiple choice Unit 1: Using Objects and Methods
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 623

Multiple choice Unit 1: Using Objects and Methods
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 624

Multiple choice Unit 1: Using Objects and Methods
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 625

Multiple choice Unit 1: Using Objects and Methods
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 626

Multiple choice Unit 1: Using Objects and Methods
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 627

Multiple choice Unit 1: Using Objects and Methods
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 628

Multiple choice Unit 1: Using Objects and Methods
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 629

Multiple choice Unit 1: Using Objects and Methods
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 630

Multiple choice Unit 1: Using Objects and Methods
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 621 of 2,811
Page 63 of 282