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.

Subtopic: Using Objects Clear filter

Questions 311–320 of 454
  1. 311
  2. 312
  3. 313
  4. 314
  5. 315
  6. 316
  7. 317
  8. 318
  9. 319
  10. 320

Question 311

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 312

Multiple choice Using Objects
Consider the following code segment. String p = "trace"; String q = p.substring(1, 4); String r = "rack"; boolean…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 313

Multiple choice Using Objects

Consider the following code segment.

String s = "method";
String t = s.substring(2);
int value = t.length() + s.indexOf(t.substring(1, 3));

What value is stored in value?

Pick an answer, then check it. The solution opens in a window.

Question 314

Multiple choice Using Objects
Consider the following code segment. double r = Math.pow(2, 3)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 315

Multiple choice Using Objects
Consider the following code segment. String s = "starter"; String t = s.substring(0, 3) +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 316

Multiple choice Using Objects
What is printed by the following code segment? String s = "computer"; String t…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 317

Multiple choice Using Objects
What is printed by the following code segment? String w = "stream"; String x =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 318

Multiple choice Using Objects
Consider the following declarations: String a = "Apple"; String b = "apple"; String c = "banana"; Which of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 319

Multiple choice Using Objects
Consider the following declaration: String s = "hello";…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 320

Multiple choice Using Objects
What is printed by the following code segment? String s1 = "pear"; String s2 = "peach"; if (s1.compareTo(s2) <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 311 of 454
Page 32 of 46