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 131–140 of 454
  1. 131
  2. 132
  3. 133
  4. 134
  5. 135
  6. 136
  7. 137
  8. 138
  9. 139
  10. 140

Question 131

Multiple choice Using Objects
public class Name { private String firstName; private String lastName; public Name(String first, String last) / / constructor { firstName = first; lastName =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 132

Multiple choice Using Objects
Which print statement will produce the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 133

Multiple choice Using Objects
Consider the following code segment. String idk = "mnomnomno"; for (int i = 0; i < idk.length(); i++) { if (idk.substring(i, i + 1).equals("m")) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 134

Multiple choice Using Objects
Consider the following method. public String lengthen(String word) { int index = 0; while (index < word.length()) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 135

Multiple choice Using Objects
Consider the following method. public int mystery(String code, int index) { if (code.indexOf("c") == index) { return index; } return mystery(code.substring(2),…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 136

Multiple choice Using Objects
Consider the following statement. int number = (int)(Math.random() * 21 + 13);…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 137

Multiple choice Using Objects
Consider the following code segment. String myString = "H"; int index = 0; while (index < 4) { for (int i = 0;i <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 138

Multiple choice Using Objects
Consider the following statement. int var = (int)(Math.random() * 50) +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 139

Multiple choice Using Objects
Consider the following method. public boolean whatDoesItDo(String st) { for (int i = 0;i < st.length() / 2;i++) { String sub1 = st.substring(i, i + 1); String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 140

Multiple choice Using Objects
Consider the following method. public String mixItUp(String entry1, String entry2) { entry2 = entry1; entry1 =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 131 of 454
Page 14 of 46