Deck 8: Polymorphism and Abstract Classes

ملء الشاشة (f)
exit full mode
سؤال
Early binding enables the compiler to be more efficient.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
You cannot create an object using a/an:

A)superclass constructor
B)subclass constructor
C)ancestor class constructor
D)abstract class constructor
سؤال
The clone method return type is:

A)the same as the cloned object
B)Object
C)String
D)none of the above
سؤال
____________ refers to the process of associating a method definition with a method invocation.

A)Binding
B)Encapsulation
C)Inheritance
D)Polymorphism
سؤال
A class that has at least one abstract method is called an:

A)concrete class
B)encapsulated class
C)abstract class
D)private class
سؤال
Polymorphism refers to the ability to associate many meanings to one method through dynamic binding.
سؤال
Java does not use late binding for methods marked as:

A)final
B)static
C)private
D)all of the above
سؤال
If you choose to use the method clone in your code,you must ___________ the clone method.

A)overload
B)encapsulate
C)override
D)protect
سؤال
__________ refers to the ability to associate many meanings to one method name by means of the late binding mechanism.

A)Inheritance
B)Encapsulation
C)Polymorphism
D)None of the above
سؤال
Assigning an object of a derived class to a variable of a base class is called:

A)static binding
B)dynamic binding
C)upcasting
D)downcasting
سؤال
__________ binding refers to the method definition being associated with the method invocation when the code is compiled.

A)Dynamic
B)Late
C)Early
D)None of the above
سؤال
An abstract class must have the modifier ___________ included in the class heading.

A)static
B)abstract
C)final
D)private
سؤال
The principals of object oriented programming include:

A)encapsulation
B)inheritance
C)polymorphism
D)all of the above
سؤال
Late binding refers to the method definition being associated with the method invocation when the method is invoked at run time.
سؤال
The clone method has ________ parameters.

A)zero
B)one
C)two
D)three
سؤال
An abstract method cannot be modified by:

A)public
B)protected
C)private
D)none of the above
سؤال
A class with no abstract methods is called a

A)concrete class
B)encapsulated class
C)abstract class
D)private class
سؤال
Assigning an object of an ancestor class to a descendent class is called:

A)static binding
B)dynamic binding
C)upcasting
D)downcasting
سؤال
A method marked as final means the compiler uses ________ binding.

A)dynamic
B)early
C)late
D)none of the above
سؤال
Java allows an instance of an abstract class to be instantiated.
سؤال
An abstract method serves as a placeholder for a method that must be defined in all derived classes.
سؤال
Draw an inheritance hierarchy to represent a shoe object.The base class should have derived classes of Dress Shoes,Tennis Shoes and Boots.
سؤال
Describe the limitations of the copy constructor.
سؤال
Downcasting should be used only in situations where it makes sense.
سؤال
What is wrong with the following method definition?
public abstract void doSomethingint count)
سؤال
The method clone has one parameter and should return a copy of the calling object.
سؤال
The type of the variable naming an object determines which method names can be used in an invocation with that calling object.
سؤال
Why should the instanceOf operator be used in conjunction with downcasting?
سؤال
What is polymorphism and how does it relate to late binding?
سؤال
The final modifier is included before the definition of the method,then the method can be redefined in a derived class.
سؤال
Explain the difference between early and late binding.
سؤال
Derive a class named Dress Shoes from the base class created in number 9 above.
سؤال
An abstract class is a class that has some methods without complete definitions.
سؤال
Java uses late binding with private methods,methods marked final,or static methods.
سؤال
What are the advantages of polymorphism?
سؤال
Derive a class named Boots from the base class created in number 9 above.
سؤال
Implement the base class in the shoe hierarchy in number 8 above.
سؤال
Write a decision statement to determine if an object should be downcast.
سؤال
Derive a class named Tennis Shoes from the base class created in number 9 above.
سؤال
What is an abstract method?
سؤال
Override the clone method inherited in the Boots class created in number 12 above.
سؤال
Override the clone method inherited in the Tennis Shoes class created in number 11 above.
سؤال
Override the clone method inherited in the Dress Shoes class created in number 10 above.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/43
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 8: Polymorphism and Abstract Classes
1
Early binding enables the compiler to be more efficient.
True
2
You cannot create an object using a/an:

A)superclass constructor
B)subclass constructor
C)ancestor class constructor
D)abstract class constructor
D
3
The clone method return type is:

A)the same as the cloned object
B)Object
C)String
D)none of the above
B
4
____________ refers to the process of associating a method definition with a method invocation.

A)Binding
B)Encapsulation
C)Inheritance
D)Polymorphism
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
5
A class that has at least one abstract method is called an:

A)concrete class
B)encapsulated class
C)abstract class
D)private class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
6
Polymorphism refers to the ability to associate many meanings to one method through dynamic binding.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
7
Java does not use late binding for methods marked as:

A)final
B)static
C)private
D)all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
8
If you choose to use the method clone in your code,you must ___________ the clone method.

A)overload
B)encapsulate
C)override
D)protect
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
9
__________ refers to the ability to associate many meanings to one method name by means of the late binding mechanism.

A)Inheritance
B)Encapsulation
C)Polymorphism
D)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
10
Assigning an object of a derived class to a variable of a base class is called:

A)static binding
B)dynamic binding
C)upcasting
D)downcasting
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
11
__________ binding refers to the method definition being associated with the method invocation when the code is compiled.

A)Dynamic
B)Late
C)Early
D)None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
12
An abstract class must have the modifier ___________ included in the class heading.

A)static
B)abstract
C)final
D)private
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
13
The principals of object oriented programming include:

A)encapsulation
B)inheritance
C)polymorphism
D)all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
14
Late binding refers to the method definition being associated with the method invocation when the method is invoked at run time.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
15
The clone method has ________ parameters.

A)zero
B)one
C)two
D)three
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
16
An abstract method cannot be modified by:

A)public
B)protected
C)private
D)none of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
17
A class with no abstract methods is called a

A)concrete class
B)encapsulated class
C)abstract class
D)private class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
18
Assigning an object of an ancestor class to a descendent class is called:

A)static binding
B)dynamic binding
C)upcasting
D)downcasting
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
19
A method marked as final means the compiler uses ________ binding.

A)dynamic
B)early
C)late
D)none of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
20
Java allows an instance of an abstract class to be instantiated.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
21
An abstract method serves as a placeholder for a method that must be defined in all derived classes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
22
Draw an inheritance hierarchy to represent a shoe object.The base class should have derived classes of Dress Shoes,Tennis Shoes and Boots.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
23
Describe the limitations of the copy constructor.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
24
Downcasting should be used only in situations where it makes sense.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
25
What is wrong with the following method definition?
public abstract void doSomethingint count)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
26
The method clone has one parameter and should return a copy of the calling object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
27
The type of the variable naming an object determines which method names can be used in an invocation with that calling object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
28
Why should the instanceOf operator be used in conjunction with downcasting?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
29
What is polymorphism and how does it relate to late binding?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
30
The final modifier is included before the definition of the method,then the method can be redefined in a derived class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
31
Explain the difference between early and late binding.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
32
Derive a class named Dress Shoes from the base class created in number 9 above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
33
An abstract class is a class that has some methods without complete definitions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
34
Java uses late binding with private methods,methods marked final,or static methods.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
35
What are the advantages of polymorphism?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
36
Derive a class named Boots from the base class created in number 9 above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
37
Implement the base class in the shoe hierarchy in number 8 above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
38
Write a decision statement to determine if an object should be downcast.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
39
Derive a class named Tennis Shoes from the base class created in number 9 above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
40
What is an abstract method?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
41
Override the clone method inherited in the Boots class created in number 12 above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
42
Override the clone method inherited in the Tennis Shoes class created in number 11 above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
43
Override the clone method inherited in the Dress Shoes class created in number 10 above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 43 في هذه المجموعة.