Multiple choice

Before a package can be used in a java program it must be___.

  1. executed

  2. referenced

  3. imported

  4. declared

  5. None of these

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In Java, packages must be imported using the import statement before they can be used in a program. This makes the classes and interfaces from the package available to your code. Packages don't need to be executed, referenced (too vague), or declared before use - they must be explicitly imported.