Interfaces
- 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 does an interface contain?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Interface contains the only declaration of the method.
- What type of methods an interface contain by default?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
By default, interface contains abstract methods. The abstract methods need to be implemented by concrete classes.
- 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.
- What happens when a constructor is defined for an interface?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Constructor is not provided by interface as objects cannot be instantiated.