There are two main differences:
-
{@code ...}
is more concise: easier to read (and type). -
Text within
{@code ...}
will be automatically HTML-escaped for you.For example,
{@code List<String>}
is equivalent to<code>List<String></code>
.
See also the documentation for {@code}
.