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 181–190 of 454
  1. 181
  2. 182
  3. 183
  4. 184
  5. 185
  6. 186
  7. 187
  8. 188
  9. 189
  10. 190

Question 181

Multiple choice Using Objects
Consider the following code segment: double pi = 3.14159; int r = 10; int area = (int)(pi *…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 182

Multiple choice Using Objects
Assume that the String variables str1 and str2 have been properly declared and initialized. Which of the following…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 183

Multiple choice Using Objects
Consider the following code segment: String phrase = "Hello, world!"; int index = phrase.indexOf("world"); if (index >= 0) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 184

Multiple choice Using Objects

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 185

Multiple choice Using Objects
Given the following code segment: String s = "ALASKA"; int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 186

Multiple choice Using Objects
What is the result when the following code segment is compiled and executed?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 187

Multiple choice Using Objects
Consider the following code segment. String s = "ban"; ArrayList<String> words = new ArrayList<String>(); words.add(s); words.add(s.substring(1));…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 188

Multiple choice Using Objects
Consider the following method. public int locate(String str, String oneLetter) { int j = 0; while (j < str.length() &&…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 189

Multiple choice Using Objects
Consider the following code segment. String a = "A"; String b = a;// Line 1 String c = a + 1;// Line 2 String d = b +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 190

Multiple choice Using Objects
Consider the following method. public int randomPoints(int n) { return (int) (n * Math.random()) + 1; } Which of the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 181 of 454
Page 19 of 46