Verityprep
Question Bank · Unit 3

AP® Computer Science A Class Creation Practice Questions

Work through AP Computer Science A practice 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 402
  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
public class Alpha { public void eeny(int a, int b) { System.out.print("alpha eeny "); } public void eeny(int a) { System.out.print("eeny alpha "); } // other…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 222

Multiple choice Writing Classes
public class Alpha { public void eeny(int a, int b) { System.out.print("alpha eeny "); } public void eeny(int a) { System.out.print("eeny alpha "); } // other…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 223

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 224

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 225

Free response Writing Classes
Write the complete SummerSpecial class for a pair of FurnitureItem objects. FurnitureItem provides String getProductID() and double getPrice(). IDs have at…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 226

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 227

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 228

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 229

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 230

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 221 of 402
Page 23 of 41