Deck 11: Inheritance

ملء الشاشة (f)
exit full mode
سؤال
Each subclass has a method named __init__ that overrides the superclass's __init__ method.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
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
سؤال
An "is a" relationship exists between a wrench and a tool.
سؤال
New attributes and methods may be added to a subclass.
سؤال
In a UML diagram depicting inheritance,you only need to write the name of the subclass.
سؤال
When a class inherits another class,it is required to use all the data attributes and methods of the superclass.
سؤال
An "is a" relationship exists between a grasshopper and a bumblebee.
سؤال
One problem with using a UML diagram is that there is no way to indicate inheritance.
سؤال
In an inheritance relationship,what is a specialized class called?

A) a superclass
B) a subclass
C) an object
D) an instance
سؤال
Base classes are also called

A) superclasses
B) derived classes
C) subclasses
D) class instances
سؤال
What does a subclass inherit from a superclass?

A) instances and attributes
B) objects and methods
C) methods and instances
D) attributes and methods
سؤال
When there are several classes that have many common data attributes,it is better to write a(n)__________ to hold all the general data.

A) superclass
B) subclass
C) object
D) method
سؤال
Polymorphism works on any two class methods that have the same name.
سؤال
A superclass inherits attributes and methods from its subclasses without any of them having to be rewritten.
سؤال
__________ allows a new class to inherit members of the class it extends.

A) Encapsulation
B) Attributes
C) Methods
D) Inheritance
سؤال
__________ has the ability to define a method in a subclass and then define a method with the same name in a superclass.

A) Inheritance
B) Encapsulation
C) Polymorphism
D) the 'is a' relationship
سؤال
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
سؤال
In a UML diagram,what does the open arrowhead point to?

A) the superclass
B) the subclass
C) the object
D) a method
سؤال
A subclass may not override any method other than the __init__ method.
سؤال
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
سؤال
Which of the following is the correct syntax for defining a class,table,which inherits from the furniture class?

A) class furniture[table]:
B) class table.furniture:
C) class furniture(table):
D) class table(furniture):
سؤال
A superclass is also called a(n)__________ class.
سؤال
In a UML diagram,a line with an open arrowhead from a subclass to a superclass indicates ___________.
سؤال
Which method can you use to determine whether an object is an instance of a class?

A) isinstance
B) isclass
C) isobject
D) issubclass
سؤال
In an inheritance relationship,a minivan can be thought of as a(n)___________ of the vehicles class.
سؤال
The term ___________ refers to an object's ability to take different forms.
سؤال
New attributes and methods may be added to a subclass which makes it a(n)__________ version of the superclass.
سؤال
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
سؤال
When a subclass method has the same name as a superclass method,the subclass method __________ the superclass method.
سؤال
The __________ function determines whether or not an object is an instance of a specific class or an instance of a subclass of that class.
سؤال
Given the following beginning of a class definition for a superclass named clock,how many accessor and mutator methods will be needed to complete the class definition?
<strong>Given the following beginning of a class definition for a superclass named clock,how many accessor and mutator methods will be needed to complete the class definition?  </strong> A) 1 mutator, 1 accessor B) 3 mutator, 4 accessor C) 3 mutator, 3 accessor D) 4 mutator, 5 accessor <div style=padding-top: 35px>

A) 1 mutator, 1 accessor
B) 3 mutator, 4 accessor
C) 3 mutator, 3 accessor
D) 4 mutator, 5 accessor
سؤال
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)
سؤال
In the following line of code,what is the name of the base class?
Class Python(Course):

A) Python
B) Course
C) Python(Course)
D) None of these
سؤال
In an inheritance relationship,the extended class is called the __________.
سؤال
A subclass is also called a(n)__________ class.
سؤال
__________ allows subclasses to have methods with the same names as methods in their superclasses.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/36
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 11: Inheritance
1
Each subclass has a method named __init__ that overrides the superclass's __init__ method.
True
2
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
A
3
An "is a" relationship exists between a wrench and a tool.
True
4
New attributes and methods may be added to a subclass.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
5
In a UML diagram depicting inheritance,you only need to write the name of the subclass.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
6
When a class inherits another class,it is required to use all the data attributes and methods of the superclass.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
7
An "is a" relationship exists between a grasshopper and a bumblebee.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
8
One problem with using a UML diagram is that there is no way to indicate inheritance.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
9
In an inheritance relationship,what is a specialized class called?

A) a superclass
B) a subclass
C) an object
D) an instance
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
10
Base classes are also called

A) superclasses
B) derived classes
C) subclasses
D) class instances
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
11
What does a subclass inherit from a superclass?

A) instances and attributes
B) objects and methods
C) methods and instances
D) attributes and methods
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
12
When there are several classes that have many common data attributes,it is better to write a(n)__________ to hold all the general data.

A) superclass
B) subclass
C) object
D) method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
13
Polymorphism works on any two class methods that have the same name.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
14
A superclass inherits attributes and methods from its subclasses without any of them having to be rewritten.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
15
__________ allows a new class to inherit members of the class it extends.

A) Encapsulation
B) Attributes
C) Methods
D) Inheritance
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
16
__________ has the ability to define a method in a subclass and then define a method with the same name in a superclass.

A) Inheritance
B) Encapsulation
C) Polymorphism
D) the 'is a' relationship
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
17
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
18
In a UML diagram,what does the open arrowhead point to?

A) the superclass
B) the subclass
C) the object
D) a method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
19
A subclass may not override any method other than the __init__ method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
20
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
21
Which of the following is the correct syntax for defining a class,table,which inherits from the furniture class?

A) class furniture[table]:
B) class table.furniture:
C) class furniture(table):
D) class table(furniture):
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
22
A superclass is also called a(n)__________ class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
23
In a UML diagram,a line with an open arrowhead from a subclass to a superclass indicates ___________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
24
Which method can you use to determine whether an object is an instance of a class?

A) isinstance
B) isclass
C) isobject
D) issubclass
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
25
In an inheritance relationship,a minivan can be thought of as a(n)___________ of the vehicles class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
26
The term ___________ refers to an object's ability to take different forms.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
27
New attributes and methods may be added to a subclass which makes it a(n)__________ version of the superclass.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
28
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
29
When a subclass method has the same name as a superclass method,the subclass method __________ the superclass method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
30
The __________ function determines whether or not an object is an instance of a specific class or an instance of a subclass of that class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
31
Given the following beginning of a class definition for a superclass named clock,how many accessor and mutator methods will be needed to complete the class definition?
<strong>Given the following beginning of a class definition for a superclass named clock,how many accessor and mutator methods will be needed to complete the class definition?  </strong> A) 1 mutator, 1 accessor B) 3 mutator, 4 accessor C) 3 mutator, 3 accessor D) 4 mutator, 5 accessor

A) 1 mutator, 1 accessor
B) 3 mutator, 4 accessor
C) 3 mutator, 3 accessor
D) 4 mutator, 5 accessor
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
32
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)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
33
In the following line of code,what is the name of the base class?
Class Python(Course):

A) Python
B) Course
C) Python(Course)
D) None of these
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
34
In an inheritance relationship,the extended class is called the __________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
35
A subclass is also called a(n)__________ class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
36
__________ allows subclasses to have methods with the same names as methods in their superclasses.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 36 في هذه المجموعة.