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

Feature Request for a more simpler Array Declaration

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: specification
    • Labels:

      Description

      A DESCRIPTION OF THE PROBLEM :
      Currently let's say
         int[] array = new int[]{1,2,3}
      looks too complicated.
      Can we improve it as
         int[] array = [1, 2, 3] ?
      or even
         var array = [1, 2, 3] ? // Compiler automatically guess the type

      and we can hae
      private int[] getSomething() {
          int a = ..... ;
          int b = .... ;
          return [a, b]
      }


        Attachments

          Activity

            People

            • Assignee:
              smarks Stuart Marks
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: