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 251–260 of 359
  1. 251
  2. 252
  3. 253
  4. 254
  5. 255
  6. 256
  7. 257
  8. 258
  9. 259
  10. 260

Question 251

Multiple choice Writing Classes
Consider the following classes. public class TextTools { public String repeatFirst(String word) { return word.substring(0,1) + word; } } public class…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 252

Multiple choice Writing Classes
Consider the following classes. public class CodeTools { public String merge(String a, String b) { return a.substring(0,1) + b.substring(0,1) +…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 253

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 254

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 255

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 256

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 257

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 258

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 259

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 260

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 251 of 359
Page 26 of 36