CodeHS 4.14 Polymorphism

CodeHS 4.14 Polymorphism

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

After Effect Intoduction

After Effect Intoduction

10th Grade - University

15 Qs

Inspire - AI Trivia

Inspire - AI Trivia

11th Grade

10 Qs

OOP 1 Undiksha

OOP 1 Undiksha

12th Grade - University

13 Qs

Empowerment Technologies Quiz 2

Empowerment Technologies Quiz 2

11th Grade

10 Qs

Chapter 3 Exploring Linux Filesystems

Chapter 3 Exploring Linux Filesystems

11th Grade - University

10 Qs

IP ADDRESSING AND ITS VERSION

IP ADDRESSING AND ITS VERSION

11th Grade

15 Qs

Networks and Internet

Networks and Internet

10th Grade

10 Qs

8525 AQA GCSE  3.1.1 Pseudo-code

8525 AQA GCSE 3.1.1 Pseudo-code

10th - 11th Grade

14 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?