good example of Javadoc

Viewed 340156

is there a good example of a source file containing Javadoc?

I can find lots of good examples of Javadoc on the internet, I would just like to find out the particular syntax used to create them, and assume I can pore through the source of some library somewhere but that seems like a lot of work.

11 Answers

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.

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.

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.

Related