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.

Questions 281–290 of 402
  1. 281
  2. 282
  3. 283
  4. 284
  5. 285
  6. 286
  7. 287
  8. 288
  9. 289
  10. 290

Question 281

Multiple choice Writing Classes
public class SegmentTools { public String firstPart(String text) { return text.substring(0, 3); } public String lastPart(String text) { return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 282

Multiple choice Writing Classes
Consider the following classes. public class TextChecker { public String adjust(String word) { if (word.length() > 4) { return word.substring(1); } else {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 283

Multiple choice Writing Classes
Consider the following classes. public class WordEditor { public String change(String text) { if (text.equals("go")) { return text + text; } else { return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 284

Multiple choice Writing Classes
Consider the following classes. public class NumberTools { public void change(int value) { value = value + 5; } } public class Calculator {…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 285

Multiple choice Writing Classes
Consider the following classes. public class Box { private int value; public Box(int v) { value = v; } public int getValue() { return value; } } public class…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 286

Multiple choice Writing Classes
Consider the following classes. public class Counter { private int value; public Counter(int v) { value = v; } public void increment() { value++; } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 287

Multiple choice Writing Classes
Consider the following class. public class Test { public static void update(int value, String text) { value = value * 2; text = text.substring(1); } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 288

Multiple choice Writing Classes
Consider the following classes. public class Box { private int size; public Box(int s) { size = s; } public void grow() { size = size + 2; } public String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 289

Multiple choice Writing Classes
Consider the following classes. public class Rectangle { private int width; public Rectangle(int w) { width = w; } public void grow(int amount) { width = width…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 290

Multiple choice Writing Classes
Consider the following classes. public class Counter { private int value; public Counter(int v) { value = v; } public void increment() { value++; } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 281 of 402
Page 29 of 41