CodeHS 4.14 Polymorphism

CodeHS 4.14 Polymorphism

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

G9 QUIZ 1 2ND QUARTER

G9 QUIZ 1 2ND QUARTER

9th Grade

15 Qs

2.GRADE STORY 5

2.GRADE STORY 5

2nd Grade - University

15 Qs

G10 Mod3 Summative Test: ICCS

G10 Mod3 Summative Test: ICCS

10th Grade

15 Qs

Virtual Memory

Virtual Memory

11th Grade

10 Qs

Y10M2A2 - Selection

Y10M2A2 - Selection

6th - 10th Grade

15 Qs

Technology in medicine

Technology in medicine

10th Grade

15 Qs

Fashion Merchandising 1.01

Fashion Merchandising 1.01

9th - 12th Grade

10 Qs

CodeHS 4.14 Polymorphism

CodeHS 4.14 Polymorphism

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Aaron Pavao

Used 21+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Media Image

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

Media Image

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

Media Image

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

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?