πŸ“š

Β >Β 

πŸ’»Β 

Β >Β 

πŸ“±

2.10 Multiple Choice Questions

3 min readβ€’december 28, 2021


AP Computer Science AΒ πŸ’»

130Β resources
See Units

Multiple Choice Practice for Using Objects

Welcome to Unit 2 AP Computer Science A Multiple Choice Questions! Grab some paper and a pencil πŸ“„ to record your answers as you go. You can see how you did on the Unit 2 Practice Questions Answers and Review sheet once you're done. Don't worry, we have tons of resources available if you get stumped πŸ˜• on a question. And if solo study is not your thing, join a group in Hours!
Not ready to take a quiz yet? Start studying unit 2 here: Intro to Unit 2
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-Is6Egji9ERRr.png?alt=media&token=cf4f1821-bc55-45d1-962e-32cfca9e03ac

This content, covered in key topic 2.6, reviews what each escape character prints.Β 

Facts about the test: The AP Computer Science A exam has 40 multiple choice questions and you will be given 90 minutes to complete the section. That means it should take you around 34 minutes to complete 15 questions.

*The following questions were not written by CollegeBoard and although they cover information outlined in the AP Computer Science A Course and Exam Description the formatting on the exam may be different.


1. Which of the following would evaluate to the number 1?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-pJKrV2XxNVwK.png?alt=media&token=63b6dd7f-cbff-4c8a-94cd-213650ca8147
A. x / y
B. y / x
C. a % b
D. (a + x) / x

2. Consider String a below. Which of the following would create a new String with the value, "ram"? String a = new String ("Java Program");
A. String b=string (a)
B. String b = a.substring(9);
C. String b= a.substring (a)
D. String b = a.substring (12)

3.Β  What special type of data is identified by the fact that it has methods, unlike primitive data?
A. objects
B. methods
C. variables
D. constants

4. Consider the code segment attached. What is the result displayed?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-cikEZXlNDCPT.png?alt=media&token=1376039f-b03e-480b-b012-ca5a4a43988a
A. 3
B. 5
C. 8
D. 125

5. What is the value of z stored after the following code is run?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-bkfIpbiYc3Fv.png?alt=media&token=9d6d9c88-da37-4745-8446-83daf467384b
A. 6
B. 6.0
C. 6.00
D. 6.00001

6. The output of the program code below will not always be the same. What is the range of numbers that could be printed?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-7adihOrnJXeL.png?alt=media&token=33550115-9d06-4de8-b18b-5eaeb5922e84
A. 0-4
B. 0-6
C. 1-5
D. 1-6

7. Which of the following is the correct import necessary to create a Scanner?
A. create.Scanner;
B. import Java-scanner;
C. import.Scanner;
D. import.util.java.Scanner;

8. What will be the result of 2 % 6?
A. 0
B. 2
C. 3
D. 4

9. Which of the following would be the most appropriate variable to store a bank account balance?
A. double bankBalance;
B. decimal money;
C. int balance;
D. long money;

10. Which operator is known as the assignment statement?
A. =
B. ==
C. -->
D. <--

11. What is the disadvantage of the import statement: import java.util.*; ?
A. there is no disadvantage
B. the file would import all code in java.util, which would make the file bigger
C. it would only import the code that has * with it
D. this doesn't exist, so it would give an error

12. Which of the following is overloading?
A. When one constructor is defined in a class
B. When a constructor takes more than one parameter
C. When a constructor takes one parameter
D. When more than one constructor is defined in a class

13. Which of the following is valid syntax for creating and initializing a World object?
A. World w = null;
B. World w = new.World;
C. World w = new.World();
D. World w = World();

14. Which of the following is the correct signature for a no-argument constructor?
A. public World()
B. public World
C. public World(int width)
D. public World(int width, int height)

15. In new World (150, 200), what are 150 and 200?
A. formal parameters
B. actual parameters
C. objects
D. classes

πŸ™ŒTime to Check Your Answers on Unit 2 Practice Questions Answers and Review!Β 
🀝Connect with other students studying AP Computer Science A with Hours
Browse Study Guides By Unit
βž•Unit 1 – Primitive Types
πŸ–₯Unit 3 – Boolean Expressions & if Statements
πŸ•ΉUnit 4 – Iteration
βš™οΈUnit 5 – Writing Classes
⌚️Unit 6 – Array
πŸ’ΎUnit 7 – ArrayList
πŸ’»Unit 8 – 2D Array
πŸ–²Unit 9 – Inheritance
πŸ–±Unit 10 – Recursion
πŸ™Exam Reviews