8316187: Modernize examples in StringTokenizer and {Date,Number}Format

Reviewed-by: naoto
This commit is contained in:
Pavel Rappo 2023-09-16 07:51:34 +00:00
parent 8f46abc938
commit c92bdb0e91
3 changed files with 7 additions and 7 deletions

View file

@ -85,8 +85,8 @@ import sun.util.locale.provider.LocaleServiceProviderPool;
* <blockquote>
* {@snippet lang=java :
* DateFormat df = DateFormat.getDateInstance();
* for (int i = 0; i < myDate.length; ++i) {
* output.println(df.format(myDate[i]) + "; ");
* for (Date myDate : dates) {
* output.println(df.format(myDate) + "; ");
* }
* }
* </blockquote>

View file

@ -82,8 +82,8 @@ import sun.util.locale.provider.LocaleServiceProviderPool;
* <blockquote>
* {@snippet lang=java :
* NumberFormat nf = NumberFormat.getInstance();
* for (int i = 0; i < myNumber.length; ++i) {
* output.println(nf.format(myNumber[i]) + "; ");
* for (var myNumber : numbers) {
* output.println(nf.format(myNumber) + "; ");
* }
* }
* </blockquote>