
AP CSA Inheritance (9.5, 9.6, 9.7)

Quiz
•
Computers
•
10th - 12th Grade
•
Hard
Herman Galioulline
Used 47+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Line 1 will cause an error because the type used to declare arr and the type used to instantiate arr are different.
Line 3 will cause an error because the type used to declare t2 and the type used to instantiate t2 are different.
Line 5 will cause an error because the types of arr[0] and t1 are different.
Line 6 will cause an error because the types of arr[1] and t2 are different.
Line 7 will cause an error because the types of arr[2] and t3 are different.
2.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Which of the following best explains why the code segment will not compile?
Line 3 causes a compile-time error because the Refrigerator class is missing the display() method.
Line 6 causes a compile-time error because the variable a1 is incorrectly instantiated.
Line 7 causes a compile-time error because the variable a2 is incorrectly instantiated.
Line 8 causes a compile-time error because the parameter a1 in the call displayFeatures(a1) has the incorrect data type.
Line 9 causes a compile-time error because the parameter a2 in the call displayFeatures(a2) has the incorrect data type.
3.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Line 3 causes a compile-time error because the variable sec should be declared as type Second.
Line 4 causes a compile-time error because the variable thr should be declared as type Third.
Line 3 causes a compile-time error because the Second class is missing the output1 method.
Line 3 causes a compile-time error because the Second class is missing the output2 method.
Line 4 causes a compile-time error because the Third class is missing the output method.
4.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Line 2 causes a compile-time error because the variable tool1 is declared as type MultiTool but is instantiated as a DeluxeMultiTool.
Line 3 causes a compile-time error because the variable tool2 is declared as type MultiTool and is instantiated as a DeluxeMultiTool.
In line 4, tool2 cannot be added to the ArrayList because it was instantiated as a DeluxeMultiTool.
In line 5, tool2 cannot be added to the ArrayList because it was declared to be of type DeluxeMultiTool.
Line 8 causes a compile-time error because the getCompass method is not defined for objects of type MultiTool.
5.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
The variable thing should be declared as a Bclass data type because thing is instantiated as a Bclass object.
The variable thing should be instantiated as an Aclass object because methodY is overridden in Bclass.
The method methodX should be removed from the Aclass definition because methodX is overridden in Bclass.
The method methodY should be removed from the Aclass definition because methodY is overridden in Bclass.
The method methodZ should be overridden in the Bclass definition because methodZ appears only in Aclass.
6.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Which of the following code segments, when executed in a class other than Vehicle or Motorized, will display Number of Wheels: 4 Max Speed: Fast ?
Vehicle obj = new Vehicle(55);
System.out.println(obj);
Vehicle obj = new Vehicle(55);
System.out.println(toString(obj));
Motorized obj = new Motorized(55);
System.out.println(obj);
Vehicle obj = new Motorized(4, 55);
System.out.println(obj);
Motorized obj = new Motorized(4, 55);
System.out.println(toString(obj));
7.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
s1.equals(s2)
s2.equals(s3)
s3.equals(s4)
s4.equals(s5)
s5.equals(s1)
8.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
I only
II only
III only
I and II
I and III
Similar Resources on Quizizz
10 questions
Gamemaker Language

Quiz
•
6th - 12th Grade
10 questions
Pemrograman Berorientasi Objek

Quiz
•
10th Grade - University
10 questions
Evaluasi Pembelajaran Materi Dasar OOP C++

Quiz
•
10th Grade
10 questions
KD-1 Dasar pemrograman python

Quiz
•
10th Grade
11 questions
JAVA QUIZ

Quiz
•
1st - 12th Grade
10 questions
Java Exceptions

Quiz
•
10th Grade
7 questions
Java Basics #2

Quiz
•
10th - 12th Grade
13 questions
Intro to IF statements

Quiz
•
KG - University
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz

Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025

Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)

Quiz
•
9th - 12th Grade
15 questions
June Review Quiz

Quiz
•
Professional Development
20 questions
Congruent and Similar Triangles

Quiz
•
8th Grade
25 questions
Triangle Inequalities

Quiz
•
10th - 12th Grade
Discover more resources for Computers
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025

Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)

Quiz
•
9th - 12th Grade
25 questions
Triangle Inequalities

Quiz
•
10th - 12th Grade
10 questions
Right Triangles: Pythagorean Theorem and Trig

Quiz
•
11th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade
65 questions
MegaQuiz v2 2025

Quiz
•
9th - 12th Grade
10 questions
GPA Lesson

Lesson
•
9th - 12th Grade