Deck 11: Inheritance

ملء الشاشة (f)
exit full mode
سؤال
Of the two classes Cola and Soda, which would most likely be the subclass?

A) Cola
B) Soda
C) Both
D) Either
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
In the following line of code, what is the name of the base class?
Class Male(Human):

A) Male
B) Human
C) Either
D) Incorrect code
سؤال
An 'is a' relationship exists between a grasshopper and a bumblebee.
سؤال
What does a subclass inherit from a superclass?

A) Instances and attributes
B) Data and methods
C) Methods and instances
D) Attributes and methods
سؤال
Base classes are also called _____.

A) superclasses
B) derived
C) subclasses
D) classes
سؤال
Each subclass has a method named __init__ that overrides the superclass's __init__.
سؤال
New attributes and methods may be added to a subclass.
سؤال
Examine the following piece of code:
Class Potato (Vegetable):
In a UML diagram, what would the open arrowhead point to?

A) Potato
B) Vegetable
C) class
D) Potato(Vegetable)
سؤال
When a class inherits another class, it is required to use all the data attributes and methods of the superclass.
سؤال
It is not possible to indicate inheritance in a UML diagram.
سؤال
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
سؤال
In the following line of code, what is the name of the subclass?
Class Rose(Flower):

A) Rose
B) Flower
C) Either
D) Incorrect code
سؤال
In a UML diagram, what does the open arrowhead point to?

A) Superclass
B) Subclass
C) Object
D) Method
سؤال
_____ allows a new class to inherit the members of the class it extends.

A) Encapsulation
B) Domain
C) Methods
D) Inheritance
سؤال
Which of the following is the correct syntax for defining a class dining which inherits from class furniture?

A) class furniture(dining)
B) class dining(furniture)
C) class furniture(dining):
D) class dining(furniture):
سؤال
What is the relationship called in which one object is a specialized version of another object?

A) Parent-child
B) Node
C) Is a
D) Class
سؤال
Which method can you use to determine whether an object is an instance of a class?

A) isinstance
B) isclass
C) isobject
D) isinheritance
سؤال
What concept involves a superclass and a subclass?

A) Polymorphism
B) Inheritance
C) Encapsulation
D) Methods
سؤال
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
سؤال
In an inheritance relationship, what is a specialized class called?

A) Superclass
B) Subclass
C) Object
D) Method
سؤال
Polymorphism works on any two class methods that have the same name.
سؤال
New attributes and methods may be added to a subclass, which makes it a(n) _______________ version of the superclass.
سؤال
In an inheritance relationship, a television is a(n) _______________ of the electronics class.
سؤال
The term _______________ refers to an object's ability to take different forms.
سؤال
_______________ allows subclasses to have methods with the same names as methods in their superclasses.
سؤال
A subclass may not override any method other than the __init__ method.
سؤال
In a UML diagram depicting inheritance, you only write the name of the subclass.
سؤال
_______________ is used to create an 'is a' relationship among classes.
سؤال
A superclass inherits attributes and methods from its subclasses without any of them having to be rewritten.
سؤال
Superclasses are also called _______________ classes.
سؤال
The _______________ function determines whether an object is an instance of a specific class, or an instance of a subclass of that class.
سؤال
A subclass is also called a(n) _______________ class.
سؤال
In an inheritance relationship, the extended class is called the _______________.
سؤال
When a subclass method has the same name as a superclass method, it is often said that the subclass method _______________ the superclass method.
سؤال
One of the ingredients of polymorphic behavior is the ability to define a method in a subclass, and then define a method with the same name in a superclass.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/35
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 11: Inheritance
1
Of the two classes Cola and Soda, which would most likely be the subclass?

A) Cola
B) Soda
C) Both
D) Either
A
2
In the following line of code, what is the name of the base class?
Class Male(Human):

A) Male
B) Human
C) Either
D) Incorrect code
B
3
An 'is a' relationship exists between a grasshopper and a bumblebee.
False
4
What does a subclass inherit from a superclass?

A) Instances and attributes
B) Data and methods
C) Methods and instances
D) Attributes and methods
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
5
Base classes are also called _____.

A) superclasses
B) derived
C) subclasses
D) classes
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
6
Each subclass has a method named __init__ that overrides the superclass's __init__.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
7
New attributes and methods may be added to a subclass.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
8
Examine the following piece of code:
Class Potato (Vegetable):
In a UML diagram, what would the open arrowhead point to?

A) Potato
B) Vegetable
C) class
D) Potato(Vegetable)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
9
When a class inherits another class, it is required to use all the data attributes and methods of the superclass.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
10
It is not possible to indicate inheritance in a UML diagram.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
11
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
12
In the following line of code, what is the name of the subclass?
Class Rose(Flower):

A) Rose
B) Flower
C) Either
D) Incorrect code
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
13
In a UML diagram, what does the open arrowhead point to?

A) Superclass
B) Subclass
C) Object
D) Method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
14
_____ allows a new class to inherit the members of the class it extends.

A) Encapsulation
B) Domain
C) Methods
D) Inheritance
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
15
Which of the following is the correct syntax for defining a class dining which inherits from class furniture?

A) class furniture(dining)
B) class dining(furniture)
C) class furniture(dining):
D) class dining(furniture):
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
16
What is the relationship called in which one object is a specialized version of another object?

A) Parent-child
B) Node
C) Is a
D) Class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
17
Which method can you use to determine whether an object is an instance of a class?

A) isinstance
B) isclass
C) isobject
D) isinheritance
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
18
What concept involves a superclass and a subclass?

A) Polymorphism
B) Inheritance
C) Encapsulation
D) Methods
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
19
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
20
In an inheritance relationship, what is a specialized class called?

A) Superclass
B) Subclass
C) Object
D) Method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
21
Polymorphism works on any two class methods that have the same name.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
22
New attributes and methods may be added to a subclass, which makes it a(n) _______________ version of the superclass.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
23
In an inheritance relationship, a television is a(n) _______________ of the electronics class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
24
The term _______________ refers to an object's ability to take different forms.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
25
_______________ allows subclasses to have methods with the same names as methods in their superclasses.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
26
A subclass may not override any method other than the __init__ method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
27
In a UML diagram depicting inheritance, you only write the name of the subclass.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
28
_______________ is used to create an 'is a' relationship among classes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
29
A superclass inherits attributes and methods from its subclasses without any of them having to be rewritten.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
30
Superclasses are also called _______________ classes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
31
The _______________ function determines whether an object is an instance of a specific class, or an instance of a subclass of that class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
32
A subclass is also called a(n) _______________ class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
33
In an inheritance relationship, the extended class is called the _______________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
34
When a subclass method has the same name as a superclass method, it is often said that the subclass method _______________ the superclass method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
35
One of the ingredients of polymorphic behavior is the ability to define a method in a subclass, and then define a method with the same name in a superclass.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.