Core Java Quiz: Packages And Interfaces In Java

10 Questions | Total Attempts: 113

SettingsSettingsSettings
Core Java Quiz: Packages And Interfaces In Java - Quiz

This is a core Java quiz consisting of questions related to packages and interfaces. You can easily solve it and score 100% marks on this test if you consider yourself a hardcore programmer. Packages in Java are a group of similar types of classes, interfaces, and sub-packages. These are basically used to group the related classes. Play the below quiz if your concepts are clear in Java language. Shall we begin it now? Best of luck, buddy!


Questions and Answers
  • 1. 
     __________ Keyword is used to create Package in java.
    • A. 

      Class

    • B. 

      Pack

    • C. 

      Interface

    • D. 

      None

  • 2. 
    Which of the following package are built-in packages?
    • A. 

      Lang

    • B. 

      Java

    • C. 

      Util

    • D. 

      All of the above

  • 3. 
    A package can be renamed without renaming the directory in which the classes are stored.
    • A. 

      True

    • B. 

      False

  • 4. 
    Which of these can be used to fully abstract a class from its implementation?
    • A. 

      Objects

    • B. 

      Packages

    • C. 

      Interfaces

    • D. 

      None of the mentioned​​

  • 5. 
    Which inheritance is achieved using interface in Java?
    • A. 

      Multiple inheritance

    • B. 

      Single inheritance

    • C. 

      Multilevel inheritance

    • D. 

      None of the above

  • 6. 
    Methods of the interface must not be ___ in nature.
    • A. 

      Static

    • B. 

      Final

    • C. 

      Native 

    • D. 

      All of the above

  • 7. 
    How many classes we are able to extend in Java?
    • A. 

      Only one class

    • B. 

      Two class

    • C. 

      Three class

    • D. 

      Four class

  • 8. 
    Which keyword is used for using interface in class?
    • A. 

      Extend

    • B. 

      Throw

    • C. 

      Implements

    • D. 

      None of the above

  • 9. 
    Which terms are included inside the package?
    • A. 

      Classes

    • B. 

      Method

    • C. 

      Interfaces

    • D. 

      All of the above

  • 10. 
    The TreeMap class is used to implement
    • A. 

      Map interface

    • B. 

      NavigableMap 

    • C. 

      AbstractMap Class

    • D. 

      All of the above

Back to Top Back to top