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.

Subtopic: Writing Classes Clear filter

Questions 171–180 of 359
  1. 171
  2. 172
  3. 173
  4. 174
  5. 175
  6. 176
  7. 177
  8. 178
  9. 179
  10. 180

Question 171

Multiple choice Writing Classes
Which of the following statements would best describe…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 172

Multiple choice Writing Classes
public class Chair { private int numberOfLegs = 4; private boolean padded; public Chair(boolean soft) { if (soft) padded = true; else padded = false; } } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 173

Multiple choice Writing Classes
public class Chair { private int numberOfLegs = 4; private boolean padded; public Chair(boolean soft) { if (soft) padded = true; else padded = false; } } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 174

Multiple choice Writing Classes
Consider the following method: public double halfRoot(int n) { return…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 175

Multiple choice Writing Classes
The changeVal method in Number should reassign value to be the value taken as the parameter and return the original value.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 176

Multiple choice Writing Classes
public class Number { private int value; public Number(int someNum) { if (someNum >= 0) value = someNum; } public int changeVal(int newVal) { / * missing code *…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 177

Multiple choice Writing Classes
The following method is intended to output "Strings match." if the two strings contain identical data and otherwise print "Strings do not match.". public void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 178

Multiple choice Writing Classes
A class called ComputerMouse has a static variable connector and a static method…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 179

Multiple choice Writing Classes
A development team is building an online bookstore that customers can use to order books. Information about inventory and customer orders is kept in a database.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 180

Multiple choice Writing Classes
In Java, instance fields (also known as instance variables) and methods can be designated…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 171 of 359
Page 18 of 36