Filters
Question type

Study Flashcards

When a subclass method has the same name as a superclass method,the subclass method __________ the superclass method.

Correct Answer

verifed

verified

A superclass inherits attributes and methods from its subclasses without any of them having to be rewritten.

Correct Answer

verifed

verified

A subclass is also called a(n)__________ class.

Correct Answer

verifed

verified

What gives a program the ability to call the correct method depending on the type of object that is used to call it?


A) Polymorphism
B) Inheritance
C) Encapsulation
D) Methods

Correct Answer

verifed

verified

In a UML diagram,a line with an open arrowhead from a subclass to a superclass indicates ___________.

Correct Answer

verifed

verified

In an inheritance relationship,what is a specialized class called?


A) a superclass
B) a subclass
C) an object
D) an instance

Correct Answer

verifed

verified

Of the two classes,Cherry and Flavor,which would most likely be the subclass?


A) Cherry
B) Flavor
C) either one
D) neither; these are inappropriate class or subclass names

Correct Answer

verifed

verified

In the following line of code,what is the name of the subclass? Class Rose(Flower) :


A) Rose
B) Flower
C) Rose(Flower)
D) None of these

Correct Answer

verifed

verified

Polymorphism works on any two class methods that have the same name.

Correct Answer

verifed

verified

New attributes and methods may be added to a subclass.

Correct Answer

verifed

verified

An "is a" relationship exists between a grasshopper and a bumblebee.

Correct Answer

verifed

verified

__________ allows a new class to inherit members of the class it extends.


A) Encapsulation
B) Attributes
C) Methods
D) Inheritance

Correct Answer

verifed

verified

Given the following line of code,in a UML diagram,what would the open arrowhead point to? Class Celery(Vegetable) :


A) Celery
B) Vegetable
C) class
D) Celery(Vegetable)

Correct Answer

verifed

verified

Each subclass has a method named __init__ that overrides the superclass's __init__ method.

Correct Answer

verifed

verified

__________ allows subclasses to have methods with the same names as methods in their superclasses.

Correct Answer

verifed

verified

What is the relationshop called in which one object is a specialized version of another object?


A) parent-child
B) node-to-node
C) is a
D) class-subclass

Correct Answer

verifed

verified

Showing 21 - 36 of 36

Related Exams

Show Answer