AP CSA - Inheritance, plus one while loop.

AP CSA - Inheritance, plus one while loop.

12th Grade

10 Qs

quiz-placeholder

Similar activities

Chapter 3: Network Topology

Chapter 3: Network Topology

12th Grade - University

15 Qs

第八章 系统软体

第八章 系统软体

12th Grade

11 Qs

IT QUIZ

IT QUIZ

10th - 12th Grade

10 Qs

TMK T6-Pengaturcaraan U1

TMK T6-Pengaturcaraan U1

5th Grade - University

13 Qs

Adopt me

Adopt me

KG - Professional Development

14 Qs

Python Generators

Python Generators

10th Grade - University

10 Qs

ASJ 12 TKJ - PERINTAH DASAR LINUX

ASJ 12 TKJ - PERINTAH DASAR LINUX

12th Grade

10 Qs

ASK Tingkatan 1: 2.2.2 Format Imej pada Fail yang Sama

ASK Tingkatan 1: 2.2.2 Format Imej pada Fail yang Sama

12th Grade - University

12 Qs

AP CSA - Inheritance, plus one while loop.

AP CSA - Inheritance, plus one while loop.

Assessment

Quiz

Computers

12th Grade

Practice Problem

Medium

Created by

Susan Moore

Used 14+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Consider classes Manager and Employee. Which should be the superclass and which should be the subclass?

Manager is the superclass.

Employee is the subclass.

Employee is the superclass.

Manager is the subclass.

Neither. Inheritance is not appropriate in this case.

Answer explanation

Media Image

Because every manager is an employee but not the other way around, the Manager class is more specialized. It is the subclass, and the Employee is the superclass.

2.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Which of the following classes BankAccount, CheckingAccount and SavingsAccount would be the superclass?

Answer explanation

Media Image

CheckingAccount and SavingsAccount both inherit from the more general class BankAccount.

3.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Media Image

Consider the method doSomething(Car c). Select all vehicle classes from Figure 1 whose objects cannot be passed to this method.

SUV

Vehicle

Truck

Motorcycle

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Should a class Quiz inherit from the class Question?

Yes

No

Answer explanation

Media Image

A Quiz class should not inherit from the class Question. A quiz isn't a question. it has questions.

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following correctly instantiates a new Painter object?

Painter kahlo = new Painter;

Painter kahlo = Painter();

kahlo Painter = new Painter();

Painter kahlo = new Painter();

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Consider the code segment.

What is the name of the superclass?

Painter

PainterPlus

turnAround

SuperPainter

Answer explanation

Media Image

The name of the superclass is indicated after the extends keyword. In this example, the superclass is Painter

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt


Fill in the blank. Inheritance represents a/an ___ relationship.

is-many

has-a

is-a

none of these

Answer explanation

Media Image

Inheritance represents an is-a relationship. For example, Dog is a Pet.

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?