Interfaces


  1. What does an interface contain?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Interface contains the only declaration of the method.


  1. Which of the following is the correct way of implementing an interface N by class M?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Concrete class implements an interface. They can be instantiated.



  1. All methods must be implemented of an interface.











  1. 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.


  1. What type of variable can be defined in an interface?











  1. 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.



  1. What will happen if we provide concrete implementation of method in interface?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    The methods of interfaces are always abstract. They provide only method definition.