diff --git a/src/java.base/share/classes/java/text/ChoiceFormat.java b/src/java.base/share/classes/java/text/ChoiceFormat.java index d63f28ed33a..94fa85cf917 100644 --- a/src/java.base/share/classes/java/text/ChoiceFormat.java +++ b/src/java.base/share/classes/java/text/ChoiceFormat.java @@ -85,7 +85,7 @@ import java.util.Arrays; *

* Here is a simple example that shows formatting and parsing: *

- *
{@code
+ * {@snippet lang=java :
  * double[] limits = {1,2,3,4,5,6,7};
  * String[] dayOfWeekNames = {"Sun","Mon","Tue","Wed","Thur","Fri","Sat"};
  * ChoiceFormat form = new ChoiceFormat(limits, dayOfWeekNames);
@@ -95,11 +95,11 @@ import java.util.Arrays;
  *     System.out.println(i + " -> " + form.format(i) + " -> "
  *                              + form.parse(form.format(i),status));
  * }
- * }
+ * } *
* Here is a more complex example, with a pattern format: *
- *
{@code
+ * {@snippet lang=java :
  * double[] filelimits = {0,1,2};
  * String[] filepart = {"are no files","is one file","are {2} files"};
  * ChoiceFormat fileform = new ChoiceFormat(filelimits, filepart);
@@ -112,13 +112,13 @@ import java.util.Arrays;
  *     testArgs[2] = testArgs[0];
  *     System.out.println(pattform.format(testArgs));
  * }
- * }
+ * } *
*

* Specifying a pattern for ChoiceFormat objects is fairly straightforward. * For example: *

- *
{@code
+ * {@snippet lang=java :
  * ChoiceFormat fmt = new ChoiceFormat(
  *      "-1#is negative| 0#is zero or fraction | 1#is one |1.0
+ * }
  * 
* And the output result would be like the following: *