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 471–480 of 2,811
  1. 471
  2. 472
  3. 473
  4. 474
  5. 475
  6. 476
  7. 477
  8. 478
  9. 479
  10. 480

Question 471

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. String s = "container"; String a = s.substring(3, 7);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 472

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. int a = 9; int b = 2; double x =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 473

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. String p = "trace"; String q = p.substring(1, 4); String r = "rack"; boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 474

Multiple choice Unit 1: Using Objects and Methods

Consider the following code segment.

String s = "method";
String t = s.substring(2);
int value = t.length() + s.indexOf(t.substring(1, 3));

What value is stored in value?

Pick an answer, then check it. The solution opens in a window.

Question 475

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. double r = Math.pow(2, 3)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 476

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment. String s = "starter"; String t = s.substring(0, 3) +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 477

Multiple choice Unit 1: Using Objects and Methods
A program that calculates a student's average from sum and count (both int) compiles and runs without crashing, but a student…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 478

Multiple choice Unit 1: Using Objects and Methods
Which of the following is a valid Java identifier that…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 479

Multiple choice Unit 1: Using Objects and Methods
What is printed by the following code segment?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 480

Multiple choice Unit 1: Using Objects and Methods
What is printed by the following code segment? int a =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 471 of 2,811
Page 48 of 282