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

Concise array literals

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic, solaris_8

      Description



      Name: mr33420 Date: 02/18/2000


      The Java programming language provides no convenient way to pass a variable
      number of arguments to a method, similar to the varargs feature of C or the
      &rest keyword of Common Lisp. This feature is extremely useful in GUI APIs, in
      constructing and manipulating collections, and in APIs for formatted output.

      One of the goals of the New I/O project, for example, is to provide a simple
      API for formatted textual output similar to the well-known printf procedure of
      the standard C library. Developers have been asking for this feature for
      years; adding it will make Java that much more attractive an alternative to C,
      C++, and Visual Basic.

      The central method of such an API accepts a format string followed by some
      arguments. The exact number of arguments required depends upon the content of
      the format string. Ideally we'd like to be able to write something like:

          Formatter f = new Formatter(System.out);
          f.fmt("%d bytes in %d seconds (%.2f KB/s)\n",
                nbytes, seconds, ((double)(nbytes / 1024) / (double)seconds));

      The Java programming language, as presently defined, does not allow this.

      This feature is being developed as JSR-065.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mr Mark Reinhold
              Reporter:
              mr Mark Reinhold
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: