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

Arrays tutorial unnecessarily uses `new String`

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: 15
    • Fix Version/s: None
    • Component/s: docs
    • Subcomponent:
    • Verification:
      Not verified

      Description

      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`.


        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: