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 91–100 of 402
  1. 91
  2. 92
  3. 93
  4. 94
  5. 95
  6. 96
  7. 97
  8. 98
  9. 99
  10. 100

Question 91

Multiple choice Writing Classes
Consider the following class declaration. public class SomeMethods { public static String testMethod(int first, int second) { return "1"; } public static String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 92

Multiple choice Writing Classes
Consider the following class definition. public class Container { private static int maxInitialOrder = 0; private int numOfItems; public Container(int n) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 93

Multiple choice Writing Classes
Consider the following methods. public static int alpha(int x) { x = x * 2; System.out.print(x); return x + 1; } public static int beta(int y) {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 94

Multiple choice Writing Classes
Consider the following class definition Consider the following class definition: public class ArrayTester { /** Returns true if x is special. */ public static…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 95

Multiple choice Writing Classes
public class BookInfo { private String author; private String bookName; / * * Creates a BookInfo object where name is the author's name and title is the title…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 96

Multiple choice Writing Classes
Consider the following class definition public class Item { private int price; / * * Postcondition: price is initialized to p. * * / public Item(int p) { / /…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 97

Multiple choice Writing Classes
public class Time { private int hrs; private int mins; private int secs; public Time() { / * implementation not shown * / } public Time(int h, int m, int s) { /…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 98

Multiple choice Writing Classes
public class Time { private int hrs; private int mins; private int secs; public Time() { / * implementation not shown * / } public Time(int h, int m, int s) { /…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 99

Multiple choice Writing Classes
Consider the following class: public class Time { private int hrs; private int mins; private int secs; public Time() { / * implementation not shown * / } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 100

Multiple choice Writing Classes
Which statement about…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 91 of 402
Page 10 of 41