2

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.

atamanroman
  • 11,607
  • 7
  • 57
  • 81

1 Answers1

1

You can use &#47; instead of /, which will not end the JavaDoc comment.

Link64
  • 718
  • 4
  • 20