Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8260480

Arrays tutorial unnecessarily uses `new String`

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • None
    • 15
    • docs
    • Not verified

      A DESCRIPTION OF THE PROBLEM :
      https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html

      `System.out.println(new String(copyTo));` can be more easily written as `System.out.println(copyTo);`. You don't need to convert a `char[]` to `String`.


            rgallard Raymond Gallardo
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: