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 251–260 of 681
  1. 251
  2. 252
  3. 253
  4. 254
  5. 255
  6. 256
  7. 257
  8. 258
  9. 259
  10. 260

Question 251

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 252

Multiple choice Primitive Types
Which of the following statements will print 1234? I. System.out.print(12 * 100…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 253

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 254

Multiple choice Primitive Types
Consider the following code snippet: public class MathOperations { public static void main(String[] args) { int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 255

Multiple choice Using Objects

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 256

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 257

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 258

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 259

Multiple choice Primitive Types
Consider the following method. public double goFigure(int n) { n %= 7; return (double) (12 / n); } What is printed…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 260

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 251 of 681
Page 26 of 69