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 141–150 of 402
  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
public class Student { private String name; private double gpa; public Student(String newName, double newGPA) { name = newName; gpa = newGPA; } public String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 142

Multiple choice Writing Classes
public class Student { private String name; private double gpa; public Student(String newName, double newGPA) { name = newName; gpa = newGPA; } public String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 143

Multiple choice Writing Classes
public class Student { private String name; private double gpa; public Student(String newName, double newGPA) { name = newName; gpa = newGPA; } public String…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 144

Multiple choice Writing Classes
Consider the following method. public int calculate(int a, int b) { a = a - b; int c = b; b = a * a; a = b - (a + c); return a; } The following code segment…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 145

Multiple choice Writing Classes
Consider the following method. public int calculate(int a, int b) { a = a - b; int c = b; b = a * a; a = b - (a + c); return a; } The following code segment…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 146

Multiple choice Writing Classes
Consider the following calculation of the area of a circle. double…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 147

Multiple choice Writing Classes
Having multiple methods in a class with the same name but with…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 148

Multiple choice Writing Classes
Consider the following method. public int mystery(int a, int b, int c) { if (a < b && a < c) { return a; } if…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 149

Multiple choice Writing Classes
🟢 🟥 ⚠️ Consider the following method. public int mystery2(int a, int b, int c) { if (a < b && a < c)…

Sign up now. It's free!

See the full question with its answer and worked solution.

Question 150

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 141 of 402
Page 15 of 41