changeset 8113:06b01083ebd7

8023997: j.l.String.join(java.lang.CharSequence, java.lang.Iterable) sample doesn't compile and is incorrect Reviewed-by: alanb
author henryjen
date Tue, 03 Sep 2013 16:05:45 -0700
parents 5920155dd080
children 2cdd1078f45b
files src/share/classes/java/lang/String.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/lang/String.java	Tue Sep 03 22:37:07 2013 +0100
+++ b/src/share/classes/java/lang/String.java	Tue Sep 03 16:05:45 2013 -0700
@@ -2457,8 +2457,8 @@
      *     String message = String.join(" ", strings);
      *     //message returned is: "Java is cool"
      *
-     *     Set<String> strings = new HashSet<>();
-     *     Strings.add("Java"); strings.add("is");
+     *     Set<String> strings = new LinkedHashSet<>();
+     *     strings.add("Java"); strings.add("is");
      *     strings.add("very"); strings.add("cool");
      *     String message = String.join("-", strings);
      *     //message returned is: "Java-is-very-cool"