How to trim the size of the ArrayList

Tutorials Shared by the Internet Community

Advertisements

  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Detail

How to trim the size of the ArrayList

Java: How to trim the unused space allocated to the ArrayList
http://beginnersbook.com/2013/12/java-arraylist-trimtosize-method-example/
  • Total Hits: 19488

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating

  •  

  • Total Votes: 232 votes

  • Category: JAVA/Collections

  • Submitted on: 2014-01-09 07:53:09

  • Submitted By: Chaitanya

  • Set as Favorite

Description:

In this tutorial we will learn how to trim the unused space allocated to the ArrayList. For e.g. If allocated space to the ArrayList can hold 200 elements but it has only 100 elements then using the trim() method would free up the memory of 100 elements    More detail...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 50.86%  118
 Two starsTwo star  Vote LeftVote MiddleVote Right 7.76%  18
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 8.62%  20
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 8.19%  19
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 24.57%  57

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.






Advertisements