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 before they can be used in a program. The import statement makes classes and interfaces from other packages available to the current code, allowing organized code reuse across different packages.