Search code examples
javaspecial-charactersjavadoc

Using < and > characters in Javadoc


I have been writing up Javadoc comments and have run into a problem. If I try to describe a list in the form:

List < String > (Assume no spaces)

the <> characters are recognized and hide the entire portion of the comment within the Javadoc. I have looked at the documentation one the oracle website here: http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html#format without any luck.

How should I format my comments such that the < String > is visible? is there a solution similar to \" when using quotation marks?


Solution

  • < and > are tag indicators in HTML, like <p>. That's why they don't show up. To fix, use &gt; and &lt;