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 141–150 of 359
  1. 141
  2. 142
  3. 143
  4. 144
  5. 145
  6. 146
  7. 147
  8. 148
  9. 149
  10. 150

Question 141

Multiple choice Writing Classes
Consider the following class declaration. public class AnotherClass { private static int val = 31; private String data; public AnotherClass(String s) { data =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 142

Multiple choice Writing Classes
Consider the following method declaration. public int workaround(int a, double b) Which of these method declarations would correctly overload the given method?…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 143

Multiple choice Writing Classes
public class Worker { private String name; private double hourlyWage; private boolean isUnionMember; public Worker() { /* implementation not shown */ } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 144

Multiple choice Writing Classes
public class Worker { private String name; private double hourlyWage; private boolean isUnionMember; public Worker() { /* implementation not shown */ } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 145

Multiple choice Writing Classes
public class Worker { private String name; private double hourlyWage; private boolean isUnionMember; public Worker() { /* implementation not shown */ } public…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 146

Multiple choice Writing Classes
An Insect class is to be written, containing the following data fields. age, which will be initialized to 0 when an Insect is constructed. nextAvailableID,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 147

Multiple choice Writing Classes
public class Address { private String street; private String city; private String state; private int zipCode; public Address(String aStreet, String aCity,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 148

Multiple choice Writing Classes
public class Address { private String street; private String city; private String state; private int zipCode; public Address(String aStreet, String aCity,…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 149

Multiple choice Writing Classes
public class AutoPart { private String description; private int partNum; private double price; public AutoPart(String desc, int pNum, double aPrice) { /*…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 150

Multiple choice Writing Classes
A certain class, SomeClass, contains a method with the following header. public int getValue(int n) Suppose that methods with the following headers are now…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 141 of 359
Page 15 of 36