Search Header Logo

CS 122 - Final Examination

Authored by Christine Pitos

Computers

University

Used 7+ times

CS 122 - Final Examination
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A way to discover which of the two classes is the base class and which is the subclass is to _______.

look at the class size

try saying the two class names together

use polymorphism

Both a and b are correct

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Employing inheritance reduces errors because ______.

the new classes have access to fewer data fields

the new classes have access to fewer methods

you can copy methods that you already created

many of the methods you need have already been used and tested

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A base class can also be called a ______.

child class

subclass

derived class

superclass

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following choices is the best example of a parent class/child class relationship?

Rose/Flower

Present/Gift

Dog/Poodle

Sparrow/Bird

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The Java keyword that creates inheritance is _____.

static

enlarge

extends

inherits

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A class named Building has a public, nonstatic method named getFloors(). If School is a child class of Building, and modelHigh is an object of type School, which of the following statements is valid?

Building.getFloors();

School.getFloors();

modelHigh.getFloors();

All of the previous statements are valid.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is true?

A child class inherits from a parent class.

A parent class inherits from a child class.

Both of the preceding statements are true.

Neither a nor b is true.

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?