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.

Questions 211–220 of 359
  1. 211
  2. 212
  3. 213
  4. 214
  5. 215
  6. 216
  7. 217
  8. 218
  9. 219
  10. 220

Question 211

Multiple choice Writing Classes
A toString method for a Point class should return a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 212

Multiple choice Writing Classes
Consider the following class: public class Accumulator { private int total = 0; private int count = 0; public void add(int n) { total += n; count++; } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 213

Multiple choice Writing Classes
A class has two instance variables int x and int y. Which method…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 214

Multiple choice Writing Classes
A class Fraction has fields int numerator and int denominator. An equals method should return true when two…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 215

Multiple choice Writing Classes
Which of the following best describes the difference…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 216

Multiple choice Writing Classes
Consider a class Counter with a private int count initialized to 0. A method reset()…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 217

Multiple choice Writing Classes
A Ticket class has fields String event and double price.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 218

Multiple choice Writing Classes
Consider the following class: public class Stack { private ArrayList<Integer> data; public Stack() { data = new ArrayList<>(); } public void push(int val) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 219

Multiple choice Writing Classes
Consider this method in a class Timer with field private int seconds: public void addMinutes(int m) { seconds += m * 60; } public String toString() { return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 220

Multiple choice Writing Classes
A class Circle has a private field double radius and the following method: public boolean isLargerThan(Circle other) { return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 211 of 359
Page 22 of 36