Skip to content
Advertisement

How to add reference to a method parameter in javadoc?

Is there a way to add references to one or more of a method’s parameters from the method documentation body? Something like:

JavaScript

Advertisement

Answer

As far as I can tell after reading the docs for javadoc there is no such feature.

Don’t use <code>foo</code> as recommended in other answers; you can use {@code foo}. This is especially good to know when you refer to a generic type such as {@code Iterator<String>} — sure looks nicer than <code>Iterator&lt;String&gt;</code>, doesn’t it!

Advertisement