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 101–110 of 454
  1. 101
  2. 102
  3. 103
  4. 104
  5. 105
  6. 106
  7. 107
  8. 108
  9. 109
  10. 110

Question 101

Multiple choice Using Objects
Which of the following statements assigns a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 102

Multiple choice Using Objects
Consider the following two methods, which are intended to return the same values when they are called with the same positive integer parameter n. public static…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 103

Multiple choice Using Objects
Consider the method replaceStr, which is intended to return a string that is identical to orig except that all occurrences of string a are replaced by string b.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 104

Multiple choice Using Objects
The following method prints the value of start and then prints every other value up to, and possibly including, end. For example, the method call printRun(1, 7)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 105

Multiple choice Using Objects
Consider the following method. / * * Precondition: lim >= 0 * / public static void printLetters(int lim) { for (int m = 0;m < lim;m++) { for (int n = 0;n <…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 106

Multiple choice Using Objects
The following incomplete method is intended to simulate a spinner in a game by returning "red", "blue", or "green" with equal probability. public static String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 107

Multiple choice Using Objects
The following method is intended to return a string that is formed by exchanging the first and last characters of its string parameter. For example, the call…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 108

Multiple choice Using Objects
Consider the following class definition. public class WordPlay { private String word; public WordPlay(String w) { word = w; } public void update(String first) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 109

Multiple choice Using Objects
What output will be produced by the following?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 110

Multiple choice Using Objects
/** Returns true if the 4-digit integer n is valid, * false otherwise. */ boolean checkNumber(int n) { int d1,d2,d3,checkDigit,nRemaining,rem; //strip off…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 101 of 454
Page 11 of 46