When I right-klick on a package -> new -> package, check the "create package-info.java", Eclipse 4.4.2 puts a template for a package-info.java into that directory. That's good. It looks like this:
/**
*
*/
/**
* @author John Doe
*
*/
package name.of.pkg;
As you can see, there are two blocks of comments. My question is: what is the purpose of the upper block?
I can't see that this shows up anywhere in the generated JavaDoc HTML. Only content in the lower comment block and above the author becomes visible in the output. The two lines that just have a star in their line are inviting but won't be visible in the output. I never saw two comment blocks in any blog or documentation about package-info.java so far.
The top piece is the license agreement. When you get into professional programming licenses become very important in letting other people know where, how, and if they may use this code.
Common sytax is:
/**
* LICENSE
*/
import java.util.*;
/**
* JavaDoc about the class
*
* @author Your Name <[email protected]>
*/
public class ClassName {}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With