Java Archives - Quiz - Explanation

The correct answers are indicated below, along with text that explains the correct answers.
 
1. The primary purpose of JAR files in relation to JavaBeans is to:
  A. Provide a means of compressing Bean resources.
  B. Serve as a standard format for distributing Beans.
  C. Support digital signatures.
  The correct answer is B.
JAR files are important to JavaBeans because they serve as a standard format for distributing Beans.
A is incorrect because even though compression can be useful for Beans that are published on the Web, the primary importance of JAR files is as a distribution format for Beans. C is incorrect for similar reasons since digital signatures can be useful for Beans with security concerns.


2. What informational file is required for a JAR file to adequately house a Bean?
  A. A header file.
  B. A make file.
  C. A manifest file.
  The correct answer is C.
A manifest file is the informational file required for a JAR file to adequately house a Bean. A and B are incorrect because header files and make files have nothing to do with packaging Beans in JAR files; header files are used to define classes in programming languages such as C++, while make files are used to outline build information for some compilers.