Java Study Group Chapter 1

5 Questions | Total Attempts: 35

SettingsSettingsSettings
Please wait...
Java Study Group Chapter 1

This is for our Java study group.


Questions and Answers
  • 1. 
    What is the correct order?
    • A. 

      Import, package, class

    • B. 

      Class, import, package

    • C. 

      Package, import, class

    • D. 

      Package, class, import

    • E. 

      Import, class, package

  • 2. 
    A class can ...
    • A. 

      Extend only a single class and implement only a single interface

    • B. 

      Extend only a single class but implement multiple interfaces

    • C. 

      Extend multiple classes but implement only a single interface

    • D. 

      Extend multiple classes and implement multiple interfaces

  • 3. 
    Which of the following are Java keywords?
    • A. 

      Goto

    • B. 

      Malloc

    • C. 

      Implementable

    • D. 

      Extends

    • E. 

      New

    • F. 

      Delete

  • 4. 
    Which are true?
    • A. 

      Abstract interfaces can have final methods.

    • B. 

      The first concrete subclass must implement all abstract methods of its superclass.

    • C. 

      Abstract classes cannot have static methods.

    • D. 

      Interfaces can declare instance variables.

    • E. 

      A protected method in a superclass that is inherited by a subclass in a different package is now available to all classes in the subclass's package.

  • 5. 
    Given the following classes defined in separate files:What will the output be on running the Test class?
    • A. 

      Compiler error for statement v=c

    • B. 

      Prints: -Vehicle:Driving--Car:Driving--Vehicle:Driving-

    • C. 

      Runtime exception for statement v=c

    • D. 

      Prints: -Vehicle:Driving--Car:Driving--Car:Driving-

    • E. 

      Prints: -Vehicle:Driving--Car:Driving-

Back to Top Back to top