File tree 1 file changed +18
-6
lines changed 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -18,19 +18,31 @@ int twoTimes(int n) {
18
18
}
19
19
```
20
20
21
- Note that any Javadoc line starting with ` @ ` , even embedded inside ` <pre> ` and
22
- ` {@code ...} ` , is interpereted as a block tag by the Javadoc parser. As such, if
23
- you wish your Javadoc to include a code block containing an annotation, you
24
- should generally avoid ` {@code ...} ` and instead write the HTML yourself,
25
- manually escaping the ` @ ` entity.
21
+ Note that any Javadoc line starting with ` @ ` , even embedded inside ` <pre> ` is
22
+ interpreted as a block tag by the Javadoc parser. As such, if you wish your
23
+ Javadoc to include a code block containing an annotation, you should surround
24
+ the snippet with ` {@code ...} ` . Alternatively, and if you are using a version of
25
+ javadoc prior to JDK 15, you may escape the symbol using ` {@literal @} `
26
+
27
+ ``` java
28
+ /**
29
+ * Designed to be overridden, such as:
30
+ *
31
+ * <pre >{@code
32
+ * class Foo {
33
+ * @Override public String toString() {return ""; }
34
+ * }
35
+ * }</pre>
36
+ */
37
+ ```
26
38
27
39
``` java
28
40
/**
29
41
* Designed to be overridden, such as:
30
42
*
31
43
* <pre >
32
44
* class Foo {
33
- * & #64 ; Override public String toString() {return "";}
45
+ * { @literal @ } Override public String toString() {return "";}
34
46
* }
35
47
* </pre>
36
48
*/
You can’t perform that action at this time.
0 commit comments