Programming - Interfaces
You Are Here :: Home > JAVA > Interfaces - General Questions
13. |
An ______________ like that of an abstract class cannot be instantiated.
|
A. |
Interface |
B.
|
Abstraction |
C.
|
Encapsulation
|
D.
|
Inheritance
|
|
Answer: Option A
Explanation:
An interface like that of an abstract class cannot be instantiated. |
|
14. |
Java does not support ___________ inheritance, but it allows you to extend one class and implement many interfaces.
|
A. |
Single |
B.
|
Multiple |
C.
|
Hierarchy
|
D.
|
Multilevel
|
|
Answer: Option B
Explanation:
Java does not support multiple inheritance, but it allows you to extend one class and implement many interfaces. |
|
15. |
An interface contains behaviors that a class implements.
|
A. |
Interface |
B.
|
Abstraction |
C.
|
Encapsulation
|
D.
|
Inheritance
|
|
Answer: Option A
Explanation:
An interface contains behaviors that a class implements. |
|
16. |
An interface cannot contain instance fields. The only fields that can appear in an interface must be declared both static and final.
|
A. |
Interface |
B.
|
Abstraction |
C.
|
Encapsulation
|
D.
|
Inheritance
|
|
Answer: Option A
Explanation:
An interface cannot contain instance fields. The only fields that can appear in an interface must be declared both static and final. |
|
17. |
The interface keyword is used to declare an interface.
|
A. |
Interface |
B.
|
Abstraction |
C.
|
Encapsulation
|
D.
|
Inheritance
|
|
Answer: Option A
Explanation:
The interface keyword is used to declare an interface. |
|
18. |
Methods in an interface are implicitly public.
|
A. |
Interface |
B.
|
Abstraction |
C.
|
Encapsulation
|
D.
|
Inheritance
|
|
Answer: Option A
Explanation:
Methods in an interface are implicitly public. |
|
« prev
next »