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

Lazy initialization of ArrayList using ArrayList(int initialCapacity)

XMLWordPrintable

      A DESCRIPTION OF THE REQUEST :
      From Java 7, the no args constructor, ArrayList() initializes the arrayList only when the first object is inserted.

      I am requesting for the same feature to be added to the other constructor as well.

      JUSTIFICATION :
      Over the period of time, I have seen that developers initialize an arrayList well before the object is required. As a result, memory space is being inefficiently held when it is not required.


            smarks Stuart Marks
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: