Verityprep
Question Bank · Unit 1

AP® Computer Science A Using Objects and Methods Practice Questions

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

Question 431

Multiple choice Primitive Types
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 Using Objects
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 Primitive Types
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 Using Objects
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 Using Objects
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 Using Objects
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 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 438

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 439

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 440

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 431 of 776
Page 44 of 78