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 121–130 of 359
  1. 121
  2. 122
  3. 123
  4. 124
  5. 125
  6. 126
  7. 127
  8. 128
  9. 129
  10. 130

Question 121

Multiple choice Writing Classes
Consider the following method. public void switcheroo(int num, int index, int[] nums) { int temp = num; num = nums[index]; nums[index] = temp; index++; }…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 122

Multiple choice Writing Classes
Consider the following class. public class Automobile { private String make, model; public Automobile(String myMake, String myModel) { make = myMake; model =…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 123

Multiple choice Writing Classes
public class Coordinates { private int x, y; public Coordinates(int myX, int myY) { x = myX; y = myY; } public void setX(int myX) { x = myX; } public int getX()…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 124

Multiple choice Writing Classes
public class Coordinates { private int x, y; public Coordinates(int myX, int myY) { x = myX; y = myY; } public void setX(int myX) { x = myX; } public int getX()…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 125

Multiple choice Writing Classes
Consider the following class declaration. public class TestClass { private double value; public TestClass(double myValue) { value = myValue; } public void…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 126

Multiple choice Writing Classes
A car dealership needs a program to store information about the cars for sale. For each car, they want to keep track of the following information: number of…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 127

Multiple choice Writing Classes
public class TimeRecord { private int hours; private int minutes; // 0<=minutes<60 public TimeRecord(int h, int m) { hours = h; minutes = m; } /** @return the…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 128

Multiple choice Writing Classes
Assume the following declarations have been made. private String s; private int n; public void changer(String x, int y) { x = x…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 129

Multiple choice Writing Classes
The relationship between a class…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 130

Multiple choice Writing Classes
Which of the following is a valid constructor declaration for the Cube class? I.…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 121 of 359
Page 13 of 36