How can I use “<” and “>” in javadoc without formatting?

前端 未结 8 1864
面向向阳花
面向向阳花 2020-12-02 13:56

If I write in a javadoc, it does not appear, because tags have special functions on formatting texts.

How can I show this chars in a

相关标签:
8条回答
  • 2020-12-02 14:47

    Considering XML is actual code, I believe XML snippets in Javadoc are better suited for the {@code A<B>C} tag rather than the {@literal A<B>C} tag.

    The {@code } tag uses a fixed-width font which makes its content standout as actual code.

    0 讨论(0)
  • 2020-12-02 14:48

    Just surround it with {@code} like this:

    {@code <xmlElement>}
    
    0 讨论(0)
提交回复
热议问题