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 551–560 of 776
  1. 551
  2. 552
  3. 553
  4. 554
  5. 555
  6. 556
  7. 557
  8. 558
  9. 559
  10. 560

Question 551

Multiple choice Primitive Types
What is printed by the following code segment?
String label = "AP";
int n = 3;
System.out.println(label + (n + 2) + n / 2);
Pick an answer, then check it. The solution opens in a window.

Question 552

Multiple choice Using Objects
Consider the following code segment. String s = "science"; String t =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 553

Multiple choice Primitive Types
Consider the following code segment.
int x = 17;
double y = x / 5 + x / 5.0;
What value is stored in y ?
Pick an answer, then check it. The solution opens in a window.

Question 554

Multiple choice Using Objects
Consider the following code segment. String a = "carpet"; String b =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 555

Multiple choice Using Objects
Consider the following declarations. String x = "stone"; String y =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 556

Multiple choice Primitive Types
Consider the following code segment. int a = 14; int b = 5;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 557

Multiple choice Using Objects
Consider the following code segment. String code = "calendar"; String part =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 558

Multiple choice Using Objects
Consider the following code segment. String a = "mark"; String b = "mask"; boolean first = a.compareTo(b) < 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 559

Multiple choice Primitive Types
Consider the following code segment. int x = 17; int y = 4; x = x / y +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 560

Multiple choice Using Objects
Consider the following code segment. String s = "container"; String a = s.substring(3, 7);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 551 of 776
Page 56 of 78