Verityprep
Question Bank · Unit 3

AP® Computer Science A Class Creation Multiple Choice Questions

Work through AP Computer Science A multiple-choice questions on Class Creation, 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: Writing Classes Clear filter

Questions 161–170 of 359
  1. 161
  2. 162
  3. 163
  4. 164
  5. 165
  6. 166
  7. 167
  8. 168
  9. 169
  10. 170

Question 161

Multiple choice Writing Classes
Consider the following class: public class Sphere { public static final double PI = 3.14159; public static double…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 162

Multiple choice Writing Classes
Consider the following class Pentagon, which represents a regular pentagon: public class Pentagon { public static final double GOLDEN_RATIO = (1 +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 163

Multiple choice Writing Classes
Consider the following method: private int swap(int a, int b) { if (a < b) { b = a; a = b; } return b - a; } What are…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 164

Multiple choice Writing Classes
Consider the following class Particle: public class Particle { public static final int START_POS = 100; private double velocity; private…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 165

Multiple choice Writing Classes
Consider the following class: public class Game { private static int bestScore; private int score; private String player; // constructors and methods not shown…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 166

Multiple choice Writing Classes
public class BookInfo { private String title; private String author; private int numPages; // constructor not shown public String toString() { return title + "…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 167

Multiple choice Writing Classes
Consider the following classes: public class BookInfo { private String title; private String author; private int numPages; // constructor not shown public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 168

Multiple choice Writing Classes
Consider the following classes: public class BookInfo { private String title; private String author; private int numPages; // constructor not shown public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 169

Multiple choice Writing Classes
Consider the following class definition: public class Class1 { public static int method1(int a, int b) { int temp = a; a = b; b = temp; return b; } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 170

Multiple choice Writing Classes
Which of the following class declarations would cause a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 161 of 359
Page 17 of 36