Deck 12: Inheritance

ملء الشاشة (f)
exit full mode
سؤال
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)
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Base classes are also called _____.

A) superclasses
B) derived
C) subclasses
D) classes
سؤال
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):
سؤال
Each subclass has a method named __init__ that overrides the superclass's __init__.
سؤال
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
سؤال
New attributes and methods may be added to a subclass.
سؤال
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
سؤال
Of the two classes Cola and Soda, which would most likely be the subclass?

A) Cola
B) Soda
C) Both
D) Either
سؤال
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
سؤال
_____ allows a new class to inherit the members of the class it extends.

A) Encapsulation
B) Domain
C) Methods
D) Inheritance
سؤال
It is not possible to indicate inheritance in a UML diagram.
سؤال
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 an inheritance relationship, what is a specialized class called?

A) Superclass
B) Subclass
C) Object
D) Method
سؤال
What does a subclass inherit from a superclass?

A) Instances and attributes
B) Data and methods
C) Methods and instances
D) Attributes and methods
سؤال
An 'is a' relationship exists between a grasshopper and a bumblebee.
سؤال
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 a UML diagram, what does the open arrowhead point to?

A) Superclass
B) Subclass
C) Object
D) Method
سؤال
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
سؤال
When a class inherits another class, it is required to use all the data attributes and methods of the superclass.
سؤال
New attributes and methods may be added to a subclass, which makes it a(n) _______________ version of the superclass.
سؤال
_______________ 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.
سؤال
In an inheritance relationship, the extended class is called the _______________.
سؤال
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.
سؤال
A subclass is also called a(n) _______________ class.
سؤال
When a subclass method has the same name as a superclass method, it is often said that the subclass method _______________ the superclass method.
سؤال
The _______________ function determines whether an object is an instance of a specific class, or an instance of a subclass of that class.
سؤال
_______________ is used to create an 'is a' relationship among classes.
سؤال
Polymorphism works on any two class methods that have the same name.
سؤال
Superclasses are also called _______________ classes.
سؤال
A superclass inherits attributes and methods from its subclasses without any of them having to be rewritten.
سؤال
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.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/35
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 12: Inheritance
1
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)
B
2
Base classes are also called _____.

A) superclasses
B) derived
C) subclasses
D) classes
A
3
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):
D
4
Each subclass has a method named __init__ that overrides the superclass's __init__.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
5
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
6
What concept involves a superclass and a subclass?

A) Polymorphism
B) Inheritance
C) Encapsulation
D) Methods
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
7
New attributes and methods may be added to a subclass.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
8
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
9
Of the two classes Cola and Soda, which would most likely be the subclass?

A) Cola
B) Soda
C) Both
D) Either
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
10
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
11
_____ 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
12
It is not possible to indicate inheritance in a UML diagram.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
13
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
14
In an inheritance relationship, what is a specialized class called?

A) Superclass
B) Subclass
C) Object
D) Method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
15
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
16
An 'is a' relationship exists between a grasshopper and a bumblebee.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
17
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
18
In a UML diagram, what does the open arrowhead point to?

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