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 451–460 of 681
  1. 451
  2. 452
  3. 453
  4. 454
  5. 455
  6. 456
  7. 457
  8. 458
  9. 459
  10. 460

Question 451

Multiple choice Using Objects
Consider the following code segment. String a = "cat"; String b = "car"; boolean x = a.compareTo(b) > 0;…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 452

Multiple choice Using Objects
What is printed by the following code segment? String s…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 453

Multiple choice Using Objects
Consider the following code segment.
String s = "computer";
String t = s.substring(0, s.indexOf("u")) + s.substring(5);
What value is stored in t ?
Pick an answer, then check it. The solution opens in a window.

Question 454

Multiple choice Primitive Types
Consider the following code segment. double y…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 455

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 456

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

Question 457

Multiple choice Primitive Types
Consider the following code segment.
int a = 11;
int b = 4;
double value = a / b + (a % b) / 2.0;
What value is stored in value after the code segment executes?
Pick an answer, then check it. The solution opens in a window.

Question 458

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 459

Multiple choice Using Objects
Consider the following declarations. String s1 = "grid"; String s2 = "grip"; boolean same = s1.equals(s2);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 460

Multiple choice Primitive Types
Consider the following code segment. Integer m = new Integer(6); Double n = new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 451 of 681
Page 46 of 69