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 221–230 of 359
  1. 221
  2. 222
  3. 223
  4. 224
  5. 225
  6. 226
  7. 227
  8. 228
  9. 229
  10. 230

Question 221

Multiple choice Writing Classes
Consider the following class and client code. public class Counter { private int count; public Counter(int start) { count = start; } public void increment(int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 222

Multiple choice Writing Classes
Consider the following class and client code. public class BankAccount { private double balance; public BankAccount(double initial) { balance = initial; }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 223

Multiple choice Writing Classes
Consider this class. public class Accumulator { private int total; public Accumulator() { total = 0; } public int addAndGet(int value) { total += value; return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 224

Multiple choice Writing Classes
Consider the following class. public class StringProcessor { private String text; public StringProcessor(String t) { text = t; } public void removeFirst() {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 225

Multiple choice Writing Classes
Consider the following class and client code. public class Point { private int x; private int y; public Point(int x, int y) { this.x = x; this.y = y; } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 226

Multiple choice Writing Classes
Consider this class. public class Fraction { private int num; private int den; public Fraction(int n, int d) { num = n; den = d; } public Fraction…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 227

Multiple choice Writing Classes
Consider the following class. public class GradeBook { private int[] scores; private int count; public GradeBook(int capacity) { scores = new int[capacity];…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 228

Multiple choice Writing Classes
Consider the following class. public class Temperature { private double celsius; public Temperature(double c) { celsius = c; } public void adjust(double delta)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 229

Multiple choice Writing Classes
Consider the following class. public class Box { private int width; private int height; public Box(int w, int h) { width = w; height = h; } public int area() {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 230

Multiple choice Writing Classes
Consider the following class. public class Wallet { private int cash; public Wallet(int c) { cash = c; } public boolean transferTo(Wallet other, int amount) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 221 of 359
Page 23 of 36