简体   繁体   English

JavaDoc中的{@code memberData}和<code> memberData </ code>之间有什么区别

[英]What is the difference between {@code memberData} and <code>memberData</code> in JavaDoc

JavaDoc中的{@code memberData}<code>memberData</code>之间有什么区别

There are two main differences: 有两个主要区别:

  1. {@code ...} is more concise: easier to read (and type). {@code ...}更简洁:更易于阅读(和输入)。

  2. Text within {@code ...} will be automatically HTML-escaped for you. {@code ...}文字将自动为您进行HTML转义。

    For example, {@code List<String>} is equivalent to <code>List&lt;String&gt;</code> . 例如, {@code List<String>}等同于<code>List&lt;String&gt;</code>

See also the documentation for {@code} . 另请参阅{@code}的文档

The {@code} is equivalent to <code> except that it uses allows you to use angle brackets < and > instead of HTML-entities &lt; {@code}等同于<code>除了它使用允许你使用尖括号<>而不是HTML实体&lt; and &gt . &gt

Example: 例:

{@code LinkedList<String>}

The Javadoc knows how to interpret it as <code> without the need of generating HTML. Javadoc知道如何将其解释为<code>而无需生成HTML。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM