package-info.java的用途,简单地说,package-info是一个java文件,可以添加到任何Java包中。package-info.java文件目前有两个用途,包级文档的存放位置、包级别注释的存放位置,除了这两点外还可以根据需要扩展用例。将来如果需要添加任何包级别的功能,此文件将是一个完美的位置。
- 包级别文档示例(将会生成Javadoc):
/**
* This module is about impact of the final keyword on performance
* <p>
* This module explores if there are any performance benefits from
* using the final keyword in our code. This module examines the performance
* implications of using final on a variable, method, and class level.
* </p>
*
* @since 1.0
* @author baeldung
* @version 1.1
*/
package com.baeldung.finalkeyword;