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 401–410 of 776
  1. 401
  2. 402
  3. 403
  4. 404
  5. 405
  6. 406
  7. 407
  8. 408
  9. 409
  10. 410

Question 401

Multiple choice Using Objects
What is the output of the following code segment? String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 402

Multiple choice Using Objects
Consider the following code segment: String str = "Computer Science"; String sub =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 403

Multiple choice Using Objects
Which of the following code segments correctly creates an…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 404

Multiple choice Primitive Types
What is the data type of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 405

Multiple choice Primitive Types
What is the value of result after the following code executes?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 406

Multiple choice Primitive Types
Consider the following code segment. double q = 15.0; int r = 2; double x = (int) (q / r); double y…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 407

Multiple choice Using Objects
Consider the following code segment. int x = ((int) (Math.random() * 10)) + 5; int y = ((int) (Math.random() * 5)) +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 408

Multiple choice Using Objects
Consider the following code segment. String str1 = "LMNOP"; String str2 =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 409

Multiple choice Primitive Types
Assume that x, y, and z are boolean variables that have been properly declared…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 410

Free response Using Objects
This question involves the `MessageBuilder` class, which is used to generate a message based on a starting word. The `MessageBuilder` class contains a helper…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 401 of 776
Page 41 of 78