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 241–250 of 681
  1. 241
  2. 242
  3. 243
  4. 244
  5. 245
  6. 246
  7. 247
  8. 248
  9. 249
  10. 250

Question 241

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 242

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 243

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 244

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 245

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 246

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 247

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 248

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 249

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 250

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 241 of 681
Page 25 of 69