Issue
To represent keywords
while writing Java Docs should I use the <code>
element or the <tt>
element? Are there specific situations when one should be preferred over the other?
Solution
For inline code in Javadocs,you should use {@code your-code-here}
See javadoc - {@code text}
for more details.
Equivalent to
<code>{@literal text}</code>
.Displays text in
code
font without interpreting the text as HTML markup or nested javadoc tags. ..
Answered By - Cephalopod
Answer Checked By - Timothy Miller (JavaFixing Admin)