good example of Javadoc [closed]

China☆狼群 提交于 2019-11-28 15:15:28

How about the JDK source code, but accessed through a 3rd party like docjar? For example, the Collections source.

That way, there's no big download.

Jared Oberhaus

The page How to Write Doc Coments for the Javadoc Tool contains a good number of good examples. One section is called Examples of Doc Comments and contains quite a few usages.

Also, the Javadoc FAQ contains some more examples to illustrate the answers.

butterchicken

How about the JDK source code?

I use a small set of documentation patterns:

  • always documenting about thread-safety
  • always documenting immutability
  • javadoc with examples (like Formatter)
  • @Deprecation with WHY and HOW to replace the annotated element

Have a look at Spring framework source, it has excellent javadocs

Download the sources of Lucene and see how they do it. They have good JavaDocs.

KrishPrabakar

If you are using Eclipse, then you can setup your JDK (not JRE) in Installed JREs, and then use Open Type (Ctrl + Shift + T), give something like java.util.Collections

The documentation of Google Guava's EventBus package and classes is a good example of Javadoc. Especially the package documentation with the quick start is well written.

If you install a JDK and choose to install sources too, the src.zip contains the source of ALL the public Java classes. Most of these have pretty good javadoc.

Jesse

If all your looking for is the syntax, then this may help:

How to Write Doc Comments for the Javadoc Tool

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!