Interfaces


  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. 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. 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. Which of these can be used to fully abstract a class from its implementation?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Interfaces



  1. Which of these access specifiers can be used for an interface?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Access specifier of an interface is either public or no specifier. When no access specifier is used then default access specifier is used due to which interface is available only to other members of the package in which it is declared, when declared public it can be used by any code.