Verityprep
Question Bank

AP® Computer Science A Multiple Choice Questions

Work through AP Computer Science A multiple-choice questions unit by unit, 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 2,811
  1. 241
  2. 242
  3. 243
  4. 244
  5. 245
  6. 246
  7. 247
  8. 248
  9. 249
  10. 250

Question 241

Multiple choice Unit 1: Using Objects and Methods
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 Unit 1: Using Objects and Methods
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 Unit 1: Using Objects and Methods
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 Unit 1: Using Objects and Methods
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 Unit 1: Using Objects and Methods
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 Unit 1: Using Objects and Methods
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 Unit 1: Using Objects and Methods
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 Unit 1: Using Objects and Methods
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 Unit 1: Using Objects and Methods
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 Unit 1: Using Objects and Methods
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 2,811
Page 25 of 282