Interfaces
- What does an interface contain?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Interface contains the only declaration of the method.
- Which of the following is the correct way of implementing an interface N by class M?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Concrete class implements an interface. They can be instantiated.
- All methods must be implemented of an interface.
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Concrete classes must implement all methods in an interface. Through interface multiple inheritance is possible.
- What type of variable can be defined in an interface?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
variable defined in an interface is implicitly final and static. They are usually written in capital letters.
- What will happen if we provide concrete implementation of method in interface?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
The methods of interfaces are always abstract. They provide only method definition.