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.

Questions 351–360 of 681
  1. 351
  2. 352
  3. 353
  4. 354
  5. 355
  6. 356
  7. 357
  8. 358
  9. 359
  10. 360

Question 351

Multiple choice Using Objects
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 352

Multiple choice Primitive Types
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 353

Multiple choice Using Objects
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 354

Multiple choice Primitive Types
Which expression produces a random…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 355

Multiple choice Using Objects
Consider the following code segment. String s = "PRACTICE"; String t = s.substring(2, 6); int result =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 356

Multiple choice Primitive Types
What is printed by the following code segment? int a = - 8, b = 3; int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 357

Multiple choice Primitive Types
The following code extracts individual digits from an integer. What is printed? int n = 2345;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 358

Multiple choice Using Objects
What is printed by the following? String p = "apple"; String q = "apricot"; String r = "app";…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 359

Multiple choice Primitive Types
What is printed? double x = Math.pow(3, 4);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 360

Multiple choice Using Objects
What is printed by the following? String msg = "artificial intelligence"; int space = msg.indexOf(" "); String first =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 351 of 681
Page 36 of 69