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 171–180 of 454
  1. 171
  2. 172
  3. 173
  4. 174
  5. 175
  6. 176
  7. 177
  8. 178
  9. 179
  10. 180

Question 171

Multiple choice Using Objects
What output is produced by the following line of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 172

Multiple choice Using Objects
Consider the following statement. int num = /* expression */; Which of the following…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 173

Multiple choice Using Objects
The following shuffle algorithm is used to shuffle an array of int values, nums. public void shuffle () { for (int k = nums.length - 1; k > 0; k--) { int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 174

Multiple choice Using Objects
Consider the following segment of code. String word = "conflagration"; int x =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 175

Multiple choice Using Objects
Which of the following will execute without throwing an exception? I String s = null; String t = ""; if (s.equals(t)) System.out.println("empty strings?"); II…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 176

Multiple choice Using Objects
Three numbers a, b, and c are said to be a Pythagorean Triple if and only if the sum of the squares of two of the numbers equals the square of the third. A…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 177

Multiple choice Using Objects
Refer to method insert described here. The insert method has two string parameters and one integer parameter. The method returns the string obtained by…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 178

Multiple choice Using Objects
Consider the following code snippet: public class Main { public static void main(String[] args) { String str =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 179

Multiple choice Using Objects
Consider the following code snippet: public class Main { public static void main(String[] args) { int x = (int) (Math.sqrt(9 *…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 180

Multiple choice Using Objects
Consider the following expressions involving strings in Java: I. "Boston".equals(new String("Boston")); II. "Bos" + "ton" == new…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 171 of 454
Page 18 of 46