Home / CSE MCQs / JAVA MCQs :: Interfaces - Java

CSE MCQs :: JAVA MCQs

  1. Which of these keywords is used to define interfaces in Java?
  2. A.
    interface
    B.
    Interface
    C.
    intf
    D.
    Intf

  3. Which of these can be used to fully abstract a class from its implementation?
  4. A.
    Objects
    B.
    Packages
    C.
    Interfaces
    D.
    None of the Mentioned.

  5. Which of these access specifiers can be used for an interface?
  6. A.
    Public
    B.
    Protected
    C.
    private
    D.
    All of the mentioned

  7. Which of these keywords is used by a class to use an interface defined previously?
  8. A.
    import
    B.
    Import
    C.
    implements
    D.
    Implements

  9. Which of the following is correct way of implementing an interface salary by class manager?
  10. A.
    class manager extends salary {}
    B.
    class manager implements salary {}
    C.
    class manager imports salary {}
    D.
    None of the mentioned.

  11. Which of the following is incorrect statement about packages?
  12. A.
    Interfaces specifies what class must do but not how it does.
    B.
    Interfaces are specified public if they are to be accessed by any code in the program.
    C.
    All variables in interface are implicitly final and static.
    D.
    All variables are static and methods are public if interface is defined pubic.

  13. Which of the following package stores all the standard java classes?
  14. A.
    lang
    B.
    java
    C.
    util
    D.
    java.packages