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 351–360 of 3,140
  1. 351
  2. 352
  3. 353
  4. 354
  5. 355
  6. 356
  7. 357
  8. 358
  9. 359
  10. 360

Question 351

Multiple choice Unit 1: Using Objects and Methods
Consider the following method: public static int mystery(int y) { y = 2 * y + y; y = 2 * y + y; return y; } Which of the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 352

Multiple choice Unit 1: Using Objects and Methods
Given the following code segment: String s1 = new String("hi"); String s2 = new String("hi"); String s3 = s2;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 353

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: String s1 = "Hi There"; String s2 = s1; String s3 = s2; String s4 =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 354

Multiple choice Unit 1: Using Objects and Methods
Given the following code segment: String s = "Computer Science is fun!"; String s1 = s.substring(0,8); String s2…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 355

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: String s1 = new String("hi"); String s2 = new String("hi there"); String s3 = s2.substring(0, 2);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 356

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: public static void test(String str, int y) { str = str + "bow"; y = y *…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 357

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: String str = "mnopqr"; for (int x = 0; x < str.length() - 1; x++) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 358

Multiple choice Unit 1: Using Objects and Methods
Consider the following code segment: int x = 2; int y = -1; while (x < 30) { x =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 359

Multiple choice Unit 1: Using Objects and Methods
Consider the following class declaration: public class Test { private int value; public Test(int n) { value = n; } public void add(int amount) { value = value +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 360

Free response Unit 1: Using Objects and Methods
This question involves the design of a simulation of birds or a bear eating from a bird feeder. You will write two methods of the Feeder class below. public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 351 of 3,140
Page 36 of 314