CodeHS 4.14 Polymorphism
Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Aaron Pavao
Used 21+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Given this hierarchy of classes, which of these declarations are illegal?
Check all that apply.
Shape foo = new Rectangle();
Shape bar = new Square();
Rectangle zim = new Square();
Ellipse dib = new Shape();
Ellipse gaz = new Circle();
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is late binding?
The proper method is called at run-time
The proper method is called at compile time
The class is assigned a superclass
A variable type is cast to another type
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Assuming Rectangle and Square are both concrete classes, which version of getArea() will be executed at run-time?
The version in Shape
The version in Rectangle
The version in Square
Trick question: there will be a compiler error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Assuming Square is a subclass of Rectangle which is a subclass of Shape and all are concrete classes, which version of getArea() will be executed at run-time?
The version in Shape
The version in Rectangle
The version in Square
Trick question: there will be a compiler error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a hierarchy?
Any group of objects ranked so that every one but the topmost is subordinate to a specified one above it
A level or rank in an organization
The bourgeoisie
The person or organization in charge
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When class Bar is based on class Foo, what do we call Foo?
subclass
superclass
extends
super
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does it mean to override a superclass method?
A method in the subclass has the same signature as one in the superclass, and the subclass method is used
A method in the subclass has the same signature as one in the superclass, and the superclass method is used
An instance variable in the subclass has the same signature as one in the superclass, and the subclass instance variable is used
A instance variable in the subclass has the same signature as one in the superclass, and the superclass instance variable is used
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
What would you do if...
Quiz
•
1st - 12th Grade
10 questions
NHTW Programming
Quiz
•
9th Grade
10 questions
Activity 1: How well do you know Java?
Quiz
•
9th Grade
15 questions
4.6.4 Logic Gates
Quiz
•
10th Grade - Professi...
12 questions
Wee Word Intro
Quiz
•
7th - 12th Grade
14 questions
TCP/IP & other protocols [A Level]
Quiz
•
12th Grade
10 questions
Abhyudaya coding class - Grade 7
Quiz
•
6th Grade - University
10 questions
MIL March 8, 2023
Quiz
•
12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
