Verityprep
Question Bank · Unit 1

AP® Computer Science A Using Objects and Methods Practice Questions

Work through AP Computer Science A practice 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 311–320 of 776
  1. 311
  2. 312
  3. 313
  4. 314
  5. 315
  6. 316
  7. 317
  8. 318
  9. 319
  10. 320

Question 311

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 312

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 313

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 314

Free response Using Objects
A WordSet, whose partial implementation is shown in the class declaration below, stores a set of String objects in no particular order and contains no…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 315

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 316

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 317

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 318

Free response Using Objects
In this question you will write two methods of an Experiment class that handles chemical solutions. A chemical solution is said to be acidic if it has a pH…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 319

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 320

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 311 of 776
Page 32 of 78