The package-info.java file
Remember the javadocs are written within the class (or interface, or enum files). There are no files to document the package information (or package javadoc). This file (package-info.java) is precisely used for that. It (which must always be named as package-info.java) contains the information about the package under which it is created. Apart from the javadoc it also serves as a placeholder for package level annotations . Instead of say deprecating the classes one by one, the annotation could be applied to this file, and the processor deprecates the entire package. This is the place where the annotation with @Target (ElementType. PACKAGE ) can be placed. In fact, the Annotation with ElementType. PACKAGE cannot be placed on any other file, except package-info.java. The file can just contain the package name and the annotation. A sample code for package-info.java is below. The comments can be generated as Javadocs. Also notice the import statement below the packag...