Deck 13: Interfaces and Inner Classes
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/32
العب
ملء الشاشة (f)
Deck 13: Interfaces and Inner Classes
1
In Java,a derived class can have ________ base classes).
A)one
B)two
C)three
D)there is no limit
A)one
B)two
C)three
D)there is no limit
A
2
An interface is a type.
True
3
The Comparable interface is in the ______________ package.
A)java.util
B)java.io
C)java.awt
D)java.lang
A)java.util
B)java.io
C)java.awt
D)java.lang
D
4
A class that implements an interface but only gives definitions for some of the method headings given in the interface is called a/an:
A)concrete class
B)abstract class
C)discrete class
D)friendly class
A)concrete class
B)abstract class
C)discrete class
D)friendly class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
5
If an inner class contains non static members,then the class name must be modified by the keyword:
A)Final
B)Static
C)Void
D)Protected
A)Final
B)Static
C)Void
D)Protected
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
6
The method that must be implemented in a class using the Comparable interface is:
A)public Object compareToObject other)
B)public Boolean compareToObject other)
C)public int compareToObject other)
D)none of the above
A)public Object compareToObject other)
B)public Boolean compareToObject other)
C)public int compareToObject other)
D)none of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
7
An interface and all of its method headings are normally declared to be:
A)public
B)private
C)protected
D)package access
A)public
B)private
C)protected
D)package access
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
8
An interface specifies the headings and definitions for methods that must be defined in any class that implements the interface.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
9
Any constant variables defined in an interface must be defined as:
A)public
B)private
C)protected
D)package access
A)public
B)private
C)protected
D)package access
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
10
You can not derive an interface from a base interface.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
11
A class may only implement one interface.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
12
Java interfaces are a way of simulating multiple inheritance.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
13
Inner classes available outside the scope of their outer class are modified by the keyword:
A)Public
B)Private
C)Protected
D)Package access
A)Public
B)Private
C)Protected
D)Package access
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
14
An interface may contain:
A)instance variables
B)primitive variables
C)constant variables
D)all of the above
A)instance variables
B)primitive variables
C)constant variables
D)all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
15
When defining an inner class to be a helper class for an outer class,the inner classes access should be marked as:
A)Public
B)Private
C)Protected
D)Package access
A)Public
B)Private
C)Protected
D)Package access
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
16
A class that uses an interface must use the keyword:
A)Extends
B)Inherits
C)Super
D)Implements
A)Extends
B)Inherits
C)Super
D)Implements
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
17
The compareTo method should return _____________ if the calling object equals the parameter.
A)A negative number
B)Zero
C)A positive number
D)Null
A)A negative number
B)Zero
C)A positive number
D)Null
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
18
When using the clone method from an inherited base class you should account for a _________ exception.
A)CloneNotFoundException
B)CloneEmptyException
C)CloneNotSupportedException
D)CloneNotEmptyException
A)CloneNotFoundException
B)CloneEmptyException
C)CloneNotSupportedException
D)CloneNotEmptyException
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
19
A common use of inner classes is :
A)clean up
B)set up
C)helper
D)all of the above
A)clean up
B)set up
C)helper
D)all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
20
A Java interface is an example of:
A)encapsulation
B)abstraction
C)polymorphism
D)all of the above
A)encapsulation
B)abstraction
C)polymorphism
D)all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
21
What are the semantics of the Comparable interface?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
22
An interface can contain defined constants as well as method headings or instead of method headings.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
23
Java source code that contains a class with an inner class,when compiled,will produce a separate .class file for the inner class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
24
What are the rules of total ordering?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
25
Why does Java only allow the inheritance of only one base class?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
26
Inner and outer classes do not have access to each other's private members.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
27
The Serializable interface is like all the other Java interfaces in that it contains defined constants and method headings.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
28
The compiler and the run-time system enforces semantics on the Comparable interface.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
29
What are two advantages to using inner classes?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
30
An inner class definition is local to the outer class definition.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
31
What is an anonymous class?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck
32
What are the obligations of a class that implements a specific interface?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 32 في هذه المجموعة.
فتح الحزمة
k this deck