πŸ“š

Β >Β 

πŸ’»Β 

Β >Β 

πŸ–²

9.8 Multiple Choice Questions

3 min readβ€’june 18, 2024


AP Computer Science AΒ πŸ’»

130Β resources
See Units

Multiple Choice Practice for Inheritance

Β 

Welcome to Unit 9 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 9 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 9 Here: Intro to Unit 9
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-uGD6gmR38pVx.png?alt=media&token=881e3d34-c179-456b-af6a-6e2dc991e465

Image From Wikipedia.

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 23 minutes to complete 10 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 one of these is the correct way to make a subclass?
A. public class SubClass extends SuperClass {}
B. public class SubClass {}
C. public class SubClass parent SuperClass {}
D. public class SubClass super SuperClass {}

2. What keyword is used to call objects in the parent class including constructors, variables, methods, etc.?
A. this
B. extends
C. requires
D. ​​super

3. Given the code below, which method successfully overloads the getItem method in the parent class?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-TIPcJJOKyHOZ.png?alt=media&token=87858dcb-f133-417a-96ef-513f0a1a4b10
A.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-PzozOvnegX5E.png?alt=media&token=ed7758e2-5c3e-4f95-be0c-3186fa7b6ff6
B.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-ZXOVVgiaXZVk.png?alt=media&token=6a175333-6cda-4f0b-b991-080c3aecbbe2
C.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-snGBfHhMcNZA.png?alt=media&token=c4a8598d-e1ce-4f8b-9b21-67729b16ed48
D.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-MdJZWyz0O9Q6.png?alt=media&token=6b0ea4c9-51c9-49ce-8104-d6050e8c11e8

4. Given the code below, which method successfully overrides the getItem method in the parent class?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-vEzj4gbxJz2V.png?alt=media&token=6ac1cf19-5172-4fd7-85d0-21af31e94851
A.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-0hXEy9eLHXT3.png?alt=media&token=c605c5f1-6bc5-4041-b085-9688b140d5d3
B.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-nuYwXyeUgsvD.png?alt=media&token=b31d3cd4-d91d-4ff0-b73d-95ee27311757
C.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-ZxSw7J4d9Ovk.png?alt=media&token=6a7cfef3-2eb8-415f-bbdc-346278d12a46
D.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-EDEge15HvWwz.png?alt=media&token=9660f8f5-99a7-4209-90cd-22857aa058cd

5. Given the code below, which one would result in the code not compiling?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-wWy7EB4ukYWF.png?alt=media&token=154a9f7b-ea3b-4704-b746-9649138c5fef
A.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-IJ2V4JOWwqtI.png?alt=media&token=0cef11fd-b260-4699-ad24-fc93687ded61
B.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-a7L5rCe5Z5E7.png?alt=media&token=d8585bdd-b1fe-4238-861b-739147651612
C.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-ubLcebK9eRiC.png?alt=media&token=fa1fcd99-f4db-4dbe-b9c2-9b2d8ad3160f
D.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-w6OhY6IBXStB.png?alt=media&token=f23a22ca-3306-43cf-9e0b-6f76cc66697e

6. Given the classes and subclasses created below, which object creation results in an exception when it executes?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-hMA0zwD2Y7FW.png?alt=media&token=efbc6cb0-7860-4d19-8441-a570fc7c4b52
A.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-EIfYZRJJ8S5z.png?alt=media&token=ca35d9c9-3074-4037-b560-a5340205959d
B.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-S9femjYsum3P.png?alt=media&token=7212fcfc-ce27-459c-a74f-492714eb8b79
C.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-m9zcOKyB3mV8.png?alt=media&token=aa48d93c-1bdf-4c23-a50f-dd8fea132cc4
D.Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-5jxfS17VbxA2.png?alt=media&token=3554c95b-79f8-48c6-91e8-d7f82a4efe92

7. Given the code below, what will be printed out if the code in another class is called?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-X88ViwgXp3Fr.png?alt=media&token=b40701a7-527d-4c3b-995d-a2b6e896bde1
A. OneTwo
B. Three
C. OneTwoFourThree
D. OneTwoThreeFour

8. What methods are usually inherited from the Object superclass that are often overriden?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-vqgEanfDwj0o.png?alt=media&token=432126e7-7e77-43c9-99d0-edcdd76f6f57
A.Β I
B.Β II
C.Β I, II
D.Β I, II, III

9. What does the keyword static mean when used?
A. This variable/method belongs to the class and is not specific for each instance created of that class.
B. This variable/method belongs to an object created of the class and is specific for each instance created of that class.
C. This variable/method belongs to the class and is specific for each instance created of that class.
D. This variable/method belongs to an object created of the class and is not specific for each instance created of that class.

10. Given the classes below, what will be returned if the following main method is called?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-hEXD9TY9FnlQ.png?alt=media&token=18860e0c-5d4a-4137-9d64-6657f8e637ad
A. 25.25
B. 30.75
C. compiler error due to a CottonPillow object created in place of a Pillow object
D. compiler error due to CottonPillow not having a getActualCost() method

Time to Check Your Answers on Unit 9 Practice Questions Answers and Review! πŸ™Œ
Browse Study Guides By Unit
βž•Unit 1 – Primitive Types
πŸ“±Unit 2 – Using Objects
πŸ–₯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 Skills

Fiveable
Fiveable
Home
Stay Connected

Β© 2024 Fiveable Inc. All rights reserved.


Β© 2024 Fiveable Inc. All rights reserved.