Given the following javadoc documented snippet:
/**
* Code example:
*
<pre>
// call foo like this:
foo("/**/*/?.txt");
</pre>
*
*/
public void foo(String glob) {
}
How can I properly escape character sequences like /**
and */
in a <pre>
block in javadoc?
I've tried {@code}
and backslashes, but either the escape characters show in the resulting javadoc or the code does not compile because the javadoc block ends prematurely.
答案 0 :(得分:1)
您可以使用/
代替/
,这不会结束JavaDoc评论。