Programming - Interfaces
You Are Here :: Home > JAVA > Interfaces - General Questions
7. |
An _________________ defines a protocol of communication between two objects.
|
A. |
Interface |
B.
|
Abstraction |
C.
|
Encapsulation
|
D.
|
Inheritance
|
|
Answer: Option A
Explanation:
An interface defines a protocol of communication between two objects. |
|
8. |
An ___________ declaration contains signatures, but no implementations, for a set of methods, and might also contain constant definitions.
|
A. |
Interface |
B.
|
Abstraction |
C.
|
Encapsulation
|
D.
|
Inheritance
|
|
Answer: Option A
Explanation:
An interface declaration contains signatures, but no implementations, for a set of methods, and might also contain constant definitions. |
|
9. |
A class that implements an interface must implement all the methods declared in the ______________.
|
A. |
Interface |
B.
|
Abstraction |
C.
|
Encapsulation
|
D.
|
Inheritance
|
|
Answer: Option A
Explanation:
A class that implements an interface must implement all the methods declared in the interface. |
|
10. |
An _______________ name can be used anywhere a type can be used.
|
A. |
Interface |
B.
|
Abstraction |
C.
|
Encapsulation
|
D.
|
Inheritance
|
|
Answer: Option A
Explanation:
An interface name can be used anywhere a type can be used. |
|
11. |
In Java, this multiple inheritance problem is solved with a powerful construct called _____________.
|
A. |
Interface |
B.
|
Abstraction |
C.
|
Encapsulation
|
D.
|
Inheritance
|
|
Answer: Option A
Explanation:
In Java, this multiple inheritance problem is solved with a powerful construct called interfaces. |
|
12. |
____________ can be used to define a generic template and then one or more abstract classes to define partial implementations of the interface.
|
A. |
Interface |
B.
|
Abstraction |
C.
|
Encapsulation
|
D.
|
Inheritance
|
|
Answer: Option A
Explanation:
Interface can be used to define a generic template and then one or more abstract classes to define partial implementations of the interface. |
|
« prev
next »