Video 9.5

Video 9.5

Assessment

Interactive Video

Computers

11th Grade

Medium

Created by

Lauren Wheelwright

Used 1+ times

FREE Resource

3 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Given that a Student is a Person, which of the following objects can be created?

obj2 & obj4

obj1, obj2, obj4

All of these are valid


obj2, obj3, obj4

Answer explanation

Polymorphism works in this format: Superclass myVariable = new Subclass();

Clothing j = new Jeans(); // This works because all Jeans are Clothing

Jeans c = new Clothing(); // This doesn't work because not all Clothing is Jeans

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given that the Student class and the Worker class both extend from the Person class, what types of objects could be stored to the following array?

Person[] people = new Person[10];

Only Person objects

Student or Worker or Person objects, but not all three

Student, Worker, and Person objects

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Given that a MixedDog is a Dog, what is the correct way to create an array list to store both MixedDog objects and Dog objects?

ArrayList<Dog> dogs = new ArrayList<Dog>();

ArrayList<Dog> dogs = new ArrayList<MixedDog>();

ArrayList<MixedDog> dogs = new ArrayList<Dog>();


ArrayList<MixedDog> dogs = new ArrayList<MixedDog>();

Access all questions and much more by creating a free account

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

Already have an account?