Deck 13: Interfaces and Inner Classes

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