Verityprep
Question Bank

AP® Computer Science A Practice Questions

Work through AP Computer Science A practice 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 431–440 of 3,140
  1. 431
  2. 432
  3. 433
  4. 434
  5. 435
  6. 436
  7. 437
  8. 438
  9. 439
  10. 440

Question 431

Multiple choice Unit 1: Using Objects and Methods
Consider the following method: public static int f(int a, int b, int c) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 432

Multiple choice Unit 1: Using Objects and Methods
Given String s = "abcdefgh", what is the value of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 433

Multiple choice Unit 1: Using Objects and Methods
What is the result of the following expression?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 434

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: String s = "programming"; String t =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 435

Multiple choice Unit 1: Using Objects and Methods
Which of the following correctly extracts the last three…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 436

Multiple choice Unit 1: Using Objects and Methods
A method repeat is defined as: public static String repeat(String s, int n) { String r = "";…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 437

Multiple choice Unit 1: Using Objects and Methods
What is the output of the following code? String[] tokens = " hello…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 438

Multiple choice Unit 1: Using Objects and Methods
What is the value of result after the following executes? int a =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 439

Multiple choice Unit 1: Using Objects and Methods
Consider the following method: public static String encode(String s) { String result = ""; for (int i =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 440

Multiple choice Unit 1: Using Objects and Methods
Which expression produces a random…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 431 of 3,140
Page 44 of 314