Multiple choice

Which of the following statements regarding the packages is correct in Java?

  1. Packages contain a single package statement.

  2. Packages can contain any number of import statements.

  3. Packages contain a single public class consisting of main() function declaration.

  4. Packages contain any number of classes private to the package.

  5. Packages can contain any number of package declarations.

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

This statement is the essential one as execution of the program starts from main() function, which is to be defined in any particular class with public access.