How can I use "<" and ">" in javadoc without formatting?

You can use &lt; for < and &gt; for > .


Recent versions of JavaDoc support {@literal A<B>C}; this outputs the content correctly (escaping the '<' and '>' in the generated HTML).

See http://download.oracle.com/javase/1.5.0/docs/guide/javadoc/whatsnew-1.5.0.html


Considering XML is actual code, I believe XML snippets in Javadoc are better suited for the {@code A<B>C} tag rather than the {@literal A<B>C} tag.

The {@code } tag uses a fixed-width font which makes its content standout as actual code.


Escape them as HTML: &lt; and &gt;