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 201–210 of 359
  1. 201
  2. 202
  3. 203
  4. 204
  5. 205
  6. 206
  7. 207
  8. 208
  9. 209
  10. 210

Question 201

Multiple choice Writing Classes
Consider the following class declaration. public class SeatLocation { private String row; // "A", "B", "C", ... , "Z", "AA", "BB", ... , "ZZ" private int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 202

Multiple choice Writing Classes
Consider the following class declaration. public class SimpleInt { private int myInt; public void setVal(int v) { myInt = v; } public int getVal() {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 203

Multiple choice Writing Classes
Consider the following class: public class Counter { private int count; public Counter() { count = 0; } public void increment() { count++; } public int…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 204

Multiple choice Writing Classes
Consider: public class Rectangle { private double width, height; public Rectangle(double w, double h) { width = w; height = h; } public double area() { return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 205

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

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 206

Multiple choice Writing Classes
A class Thermometer stores temperature as a double in Celsius. Which method correctly…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 207

Multiple choice Writing Classes
Which of the following is a valid constructor for a…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 208

Multiple choice Writing Classes
Consider a class Pair with two int fields first and second. A method swap is intended to…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 209

Multiple choice Writing Classes
Consider the following class: public class Wallet { private double balance; public Wallet(double initial) { balance = initial; } public void spend(double…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 210

Multiple choice Writing Classes
A BankAccount class has a private field balance and a method: public void deposit(double amount) { if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 201 of 359
Page 21 of 36